How to use Sub and GetAtt functions at the same time in CloudFormation template?

前端 未结 4 2032
忘了有多久
忘了有多久 2021-01-01 10:40

I create CloudFormation yaml template and I need to use !GetAtt \"TestLambda.Arn\" as part of !Sub function in \"AWS::ApiGateway::Method\" Integrat

4条回答
  •  不思量自难忘°
    2021-01-01 11:19

    AWS CloudFormation provides several built-in functions that help you manage your stacks. Use intrinsic functions in your templates to assign values to properties that are not available until runtime.

    Source from AWS

    The Fn::GetAtt intrinsic function returns the value of an attribute from a resource in the template.

    Declaration

    • JSON
      • { "Fn::GetAtt" : [ "logicalNameOfResource", "attributeName" ] }
    • YAML
      • Syntax for the full function name:
      • Fn::GetAtt: [ logicalNameOfResource, attributeName ]
    • Syntax for the short form:
      • !GetAtt logicalNameOfResource.attributeName

    Note: Should not confuse with double colon: Fn::GetAtt is like Fn_GetAtt

提交回复
热议问题