Created
July 6, 2020 12:38
-
-
Save rarous/96d9615c7de128203948767f4a95bbd0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const apiCertificate = getCertificate(this.domainName); | |
this.apiDistribution = new aws.apigateway.DomainName(name, { | |
domainName: this.domainName, | |
endpointConfiguration: { types: "EDGE" }, | |
securityPolicy: "TLS_1_2", | |
certificateArn: apiCertificate.apply(x => x.arn) | |
}); | |
const hostedZone = getHostedZone(this.domainName); | |
this.dnsRecord = new aws.route53.Record(name, { | |
name: this.domainName, | |
zoneId: hostedZone.apply(x => x.zoneId), | |
type: "A", | |
aliases: [ | |
{ | |
evaluateTargetHealth: true, | |
name: this.apiDistribution.cloudfrontDomainName, | |
zoneId: this.apiDistribution.cloudfrontZoneId | |
} | |
] | |
}); | |
this.mapping = new aws.apigateway.BasePathMapping(name, { | |
restApi: this.gateway.restAPI, | |
stageName: this.gateway.stage.stageName, | |
domainName: this.apiDistribution.domainName, | |
basePath: this.basePath | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment