Skip to content

Instantly share code, notes, and snippets.

@jugyo
Last active April 13, 2019 04:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jugyo/39fabf35a8412fc8fa39ecd5f74dfa0e to your computer and use it in GitHub Desktop.
Save jugyo/39fabf35a8412fc8fa39ecd5f74dfa0e to your computer and use it in GitHub Desktop.
# Depends on App
AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: An example SAM template for Lambda Safe Deployments.
Parameters:
DomainName:
Type: String
CertificateArn:
Type: String
HostedZoneId:
Type: String
ApiName:
Type: String
Resources:
customDomain:
Type: AWS::ApiGateway::DomainName
Properties:
DomainName: !Ref DomainName
EndpointConfiguration:
Types:
- REGIONAL
RegionalCertificateArn: !Ref CertificateArn
dnsRecord:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneId: !Ref HostedZoneId
RecordSets:
- Type: A
Name: !Ref DomainName
AliasTarget:
HostedZoneId: !GetAtt customDomain.RegionalHostedZoneId
DNSName: !GetAtt customDomain.RegionalDomainName
domainMapping:
Type: AWS::ApiGateway::BasePathMapping
DependsOn: customDomain
Properties:
DomainName: !Ref DomainName
RestApiId: !ImportValue AppRestApiId
Stage: Prod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment