CDK Constructs for AWS Route53 Alias Targets
Project description
Route53 Alias Record Targets for the CDK Route53 Library
This library contains Route53 Alias Record targets for:
- API Gateway custom domains
new route53.ARecord(this, 'AliasRecord', { zone, target: route53.RecordTarget.fromAlias(new alias.ApiGateway(restApi)), // or - route53.RecordTarget.fromAlias(new alias.ApiGatewayDomainName(domainName)), });
- CloudFront distributions
new route53.ARecord(this, 'AliasRecord', { zone, target: route53.RecordTarget.fromAlias(new alias.CloudFrontTarget(distribution)), });
- ELBv2 load balancers
new route53.ARecord(this, 'AliasRecord', { zone, target: route53.RecordTarget.fromAlias(new alias.LoadBalancerTarget(elbv2)), // or - route53.RecordTarget.fromAlias(new alias.ApiGatewayDomainName(domainName)), });
- Classic load balancers
new route53.ARecord(this, 'AliasRecord', { zone, target: route53.RecordTarget.fromAlias(new alias.ClassicLoadBalancerTarget(elb)), // or - route53.RecordTarget.fromAlias(new alias.ApiGatewayDomainName(domainName)), });
- S3 Bucket WebSite:
Important: The Bucket name must strictly match the full DNS name. See the Developer Guide for more info.
const [recordName, domainName] = ['www', 'example.com'];
const bucketWebsite = new Bucket(this, 'BucketWebsite', {
bucketName: [recordName, domainName].join('.'), // www.example.com
publicReadAccess: true,
websiteIndexDocument: 'index.html',
});
const zone = HostedZone.fromLookup(this, 'Zone', {domainName}); // example.com
new route53.ARecord(this, 'AliasRecord', {
zone,
recordName, // www
target: route53.RecordTarget.fromAlias(new alias.BucketWebsiteTarget(bucket)),
});
See the documentation of @aws-cdk/aws-route53
for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for aws-cdk.aws-route53-targets-1.10.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d521982d066e6c50c988a73c6eb628b7a263e0c541d930fb3b5fd70fe8152697 |
|
MD5 | 3523b519983fbc8240e0d3e98a01ad8c |
|
BLAKE2b-256 | a774d0afec3f6b9c6322fb260dc6b2195adfa6206bb775d6eb4415ba59ea3a9e |
Close
Hashes for aws_cdk.aws_route53_targets-1.10.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68fd2a5d938a980f8e0fb25c44f19c5b2b84ac0f85c175d8d6784fc82c07634e |
|
MD5 | ac5b3aa4706746536bb07adf66c0533e |
|
BLAKE2b-256 | 1dc0603f7581b115e33675dd392f079317534860d3230dea33aa53b789423e43 |