Skip to content

Instantly share code, notes, and snippets.

@mearns
Last active May 25, 2019 02:25
Show Gist options
  • Save mearns/b081aec5e9c10fcd5e3f5ccf3fa1488f to your computer and use it in GitHub Desktop.
Save mearns/b081aec5e9c10fcd5e3f5ccf3fa1488f to your computer and use it in GitHub Desktop.
CloudFormation template for API Gateway Hostname Discovery
"Resources": {
"ApiGatewayRestApi": {
"Type": "AWS::ApiGateway::RestApi",
"Properties": { /* ... */ }
},
"ApiHostParam": {
"Type": "AWS::SSM::Parameter",
"Properties": {
"Name": {
"Fn::Sub": "/some/unique/path/probably/including/${App}/${Stage}/hostname",
},
"Type": "String",
"Value": {
"Fn::Sub": "${ApiGatewayRestApi}.execute-api.${AWS::Region}.amazonaws.com"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment