我需要访问已使用 Cloudformation SAM 模板创建并订阅的网关的 arn。
当我尝试以下操作时,出现错误“输出块中未解决的资源依赖项 [GetResource]”。
AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31
Resources:
TestFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: dist
Handler: index.handler
Events:
GetResource:
Type: Api
Properties:
Path: /path
Method: get
Outputs:
ReadApi:
Value: !Ref GetResource
Export:
Name: ReadApi
命令失败:/bin/sh -c aws cloudformation deploy --region "ap-southeast-2" --template-file
./serverless-output.yml --功能 CAPABILITY_IAM --堆栈名称
“萨姆测试”
未能创建变更集:服务员 ChangeSetCreateComplete 失败:
服务员遇到终端故障状态 Status: FAILED。原因:
输出块中未解决的资源依赖性 [GetResource]
模板
是否可以通过这种方式访问网关引用?
您可以使用以下方式访问隐式 Rest API 资源的 Id!Ref ServerlessRestApi
.
SAM 中的事件生成的 API 资源可以在此处找到:https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/ generated_resources.rst#api https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)