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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb9639a58c64a7e9fbb7e3defbd62f9ec7c8defcc1d873c7840fa4c26de84632 |
|
MD5 | b577622b0eadcb1ad5b6727d7eb0e8c6 |
|
BLAKE2b-256 | 7427e739d2803469782f34960a2ae9004b67c0e6c099eb30c01414af67614944 |
Close
Hashes for aws_cdk.aws_route53_targets-1.10.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 495e2f03d6dffd2dd1cc503a37e60d1840802f5faef534a64020c9b3ee143a2f |
|
MD5 | 87027fe08735085e759aeb6063d7d291 |
|
BLAKE2b-256 | eed43be72d2d92aa172075ea54fefbf704351afd0944e1bf2d370766c3ed0a1a |