- 最新
- 最多得票
- 最多評論
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
相關內容
- AWS 官方已更新 1 年前
- AWS 官方已更新 3 年前
- AWS 官方已更新 1 年前