Skip to content

Instantly share code, notes, and snippets.

@leantorres73
Created January 14, 2021 15:46
Show Gist options
  • Save leantorres73/403e7788519b301c9588770cd9d144b2 to your computer and use it in GitHub Desktop.
Save leantorres73/403e7788519b301c9588770cd9d144b2 to your computer and use it in GitHub Desktop.
custom domain
// 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