Output Amazon API Gateway Domain Name URL in AWS CloudFormation
Unfortunately, it is currently not possible to output or use the domain name / URL of an Amazon API gateway via Fn::GetAtt in AWS CloudFormation. Therefore I provide the following CloudFormation snippets that enables you to do exaclty this. The snippets use a resource called RestApi of type AWS::ApiGateway::RestApi and a resource Stage of type AWS::ApiGateway::Stage.
Outputs:
APIDomainName:
Value: !Sub '${RestApi}.execute-api.${AWS::Region}.amazonaws.com'
APIDomainNameWithStage:
Value: !Sub '${RestApi}.execute-api.${AWS::Region}.amazonaws.com/${Stage}'
Quelle: Gist auf GitHub