CloudFormation包含Fn::GetAtt
内部函数。我怎么知道给定资源可以使用哪些属性?
ApiDefault:
Type: "AWS::ApiGateway::RestApi"
Properties:
Name: "poc"
Description: "Public interface for system-to-system order submissions."
FailOnWarnings: true
ApiDefaultDeployment:
Type: AWS::ApiGateway::Deployment
DependsOn:
- "ApiMethodImageSubmitPost"
Properties:
Description: "Production environment supporting version-1 of the interface."
RestApiId: !Ref "ApiDefault"
StageName: "v1"
...
ApiUsagePlan:
Type: "AWS::ApiGateway::UsagePlan"
Properties:
ApiStages:
- ApiId: !Ref "ApiDefault"
Stage: !GetAtt [ "ApiDefaultDeployment", "StageName" ]
在上面,“ StageName”不是有效的属性。那么,如何找到“ AWS :: ApiGateway :: Deployment”的有效属性?
答案 0 :(得分:1)
在任何给定资源in the doc的 返回值 部分中,通常在示例部分上方页面的末尾。
首先说明!Ref
函数,然后说明!GetAtt
属性(如果有)(AWS::ApiGateway::Deployment
则不是)。
在特定情况下,您可以将阶段名称作为参数传递给模板,并为!Ref
和ApiDefaultDeployment
ApiUsagePlan
传递阶段名称。