Sai*_*deh 1 yaml serverless-framework amazon-dynamodb-streams serverless
我正在尝试在 YAML 中为 DynamoDB 添加事件流,DynamoDB 表是一个根据其部署到的环境而变化的变量,我用来Fn::GetAtt确定TABLE_NAME,但它给了我一个例外。
Fn::GetAtt?例外:
missed comma between flow collection entries in "erverless.yml" at line 60,
column28:Fn::GetAtt: [ ${self:custom.TABLE_NAME ...
Run Code Online (Sandbox Code Playgroud)
代码:
custom:
TABLE_NAME : mix of account + env + name
events:
- stream:
type: dynamodb
arn:
Fn::GetAtt: [ ${self:custom.TABLE_NAME}, StreamArn ]
Run Code Online (Sandbox Code Playgroud)
在 YAML 流集合中,必须用{、}等字符的字符串加引号,因为启动流映射并启动流序列。不需要空间。所以它应该是这样的:[{[
arn:
Fn::GetAtt: [ '${self:custom.TABLE_NAME}', StreamArn ]
Run Code Online (Sandbox Code Playgroud)
有关 YAML 中几乎所有类型的引用的信息,您可以查看https://www.yaml.info/learn/quote.html(免责声明:我是作者)。
| 归档时间: |
|
| 查看次数: |
19341 次 |
| 最近记录: |