【发布时间】:2020-05-31 04:47:23
【问题描述】:
我正在运行 .net core 3.1 AWS Lambda 函数,但我无法使用 c# 从 AWS Lambda 控制台访问环境变量:
var envVariable = Environment.GetEnvironmentVariable("myVariableName");
环境变量存储在我的 lambda 函数根目录下的 .env 文件中。是否需要将 .env 文件复制到构建文件夹中才能在 lambda 函数中访问它?如何从 .env 文件访问 AWS Lambda 环境变量?
应用结构
cloudformation-template.json 指的是 .env 文件。
更新:2020 年 5 月 31 日:
我删除了 .env 文件,并将 cloudformation-template.json 中的变量直接添加为单个变量。当我尝试使用 amplify publish 命令将其推送到 aws 时,我得到一个
Resource is not in the state stackUpdateComplete
An error occured during the push operation: Resource is not in the state stackUpdateComplete error
【问题讨论】:
标签: c# .net-core aws-lambda aws-api-gateway aws-amplify