- Newest
- Most votes
- Most comments
Hi,
AWS Secrets Manager is a service built exactly to serve your use case: https://aws.amazon.com/secrets-manager/
More detals on using secrets frol Lambda: https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets_lambda.html
By the way, you .env file should also probably not be in your container image but also accessed in SM by the container. Simlar code to Lambda should be used in the container to access the secret(s)
Best,
Didier
Please read the envirnoment variable as per the below the sample code: Step 1: Node js apps const dotenv = require('dotenv'); dotenv.config(); // This will read from your .env file and set the environment variables Step 2: copy the value from envirnoment variable
FROM public.ecr.aws/lambda/nodejs:14 WORKDIR /var/task COPY . . # Copy your application code and .env file ENV VAR_NAME=value
Relevant content
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated a year ago