Based on the comments.
Since .env
is used on local workstation successfully, it can also be used on ec2 instance.
Just have to be careful with not string any sensitive information in .env
and using public repositories, as you may leak your passwords or access keys.
For storing secrets at AWS, the recommended way would be through secret manager or ssm parameter store. Also any permissions that your app may require to access these or other AWS services should be provided through instance role, not by hard codding AWS credentials into app or instance.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…