【发布时间】:2019-10-09 16:22:15
【问题描述】:
我正在尝试从使用 api 类别中的 @model 创建的 DynmoDB 表中获取 ARN。
ARN 是 /amplify/backend/api/{api-name}/build/stacks 下自动生成的 cloudformation 模板的输出。
我尝试在我的 Lambda 函数的 EventSourceMapping 中使用以下语句导入 ARN:
"EventSourceArn": {
"Fn::ImportValue": {
"Fn::Join": [
":",
[
{
"Ref": "apiGraphQLAPIIdOutput"
},
"GetAtt",
"CustomerTable",
"StreamArn"
]
]
}
},
但这会在推送到云端时引发错误:
Output 'GetAttCustomerTableStreamArn' not found in stack 'arn:aws:cloudformation:eu-central-1:124149422162:stack/myapp-stage-20191009174227-api-SHBHD6GIS7SD/5fb78d10-eaac-11e9-8a4c-0ac41be8cd2e'
我还在backend-config.json中添加了一个dependsOn,并没有解决问题
那么,在 lambda 函数的 cloudformation 模板中获取此流 ARN 的正确方法是什么?
【问题讨论】:
-
目前,I don't think there is a way。但是,有一个活跃且开放的pull request,因此这可能会在不久的将来发生变化。
标签: aws-lambda amazon-cloudformation aws-amplify amazon-dynamodb-streams