我正在使用SAM CLI v0.8.1 . 我正在尝试将环境变量MY_TABLE_VAR设置为我的资源(MyTableResource)中表的名称 . 但是,在本地运行我的应用程序时,MY_TABLE_VAR未定义 . 你能告诉我我的模板有什么问题吗?我该如何正确设置?以下是我的SAM模板:
Globals:
Function:
Timeout: 30
Runtime: nodejs8.10
Environment:
Variables:
MY_TABLE_VAR: !Ref MyTableResource
Resources:
MyTableResource:
Type: AWS::Serverless::SimpleTable
Properties:
TableName: table1
PrimaryKey:
Name: id
Type: String
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5