Created
January 14, 2021 15:46
-
-
Save leantorres73/403e7788519b301c9588770cd9d144b2 to your computer and use it in GitHub Desktop.
custom domain
This file contains 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
// CUSTOM API DOMAIN ------------------------------------------------------------------ | |
// custom domain | |
const apigatewaydomainsocket = new apigateway.CfnDomainName(this, "apigatewaydomainsocket", { | |
domainName, | |
domainNameConfigurations:[{ | |
certificateArn: wsCertificate, | |
endpointType: 'REGIONAL' | |
}] | |
}); | |
const apigatewaymappingsocket = new apigateway.CfnApiMapping(this, "apigatewaymappingsocket", { | |
domainName: apigatewaydomainsocket.ref, | |
apiId: apigatewaysocket.ref, | |
stage: apigatewaystagesocket.ref | |
}); | |
const zone = new route53.PublicHostedZone(this, 'HostedZone', { | |
zoneName: domainName | |
}); | |
// create the subdomain | |
const route53socket = new route53.CnameRecord(this, "route53socket", { | |
recordName: "ws", | |
zone, | |
domainName: apigatewaydomainsocket.attrRegionalDomainName | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment