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.11.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95dbcf9ef36fb57593096ecf0d17235ea5b99746b1fc968728c5aea5ef311e45 |
|
MD5 | bece546685b29120b0da04d54960ca6b |
|
BLAKE2b-256 | 0e5660309d6960e4742f8f624e95731b49016b2a0ec76921ba3f1278f1b80039 |
Close
Hashes for aws_cdk.aws_route53_targets-1.11.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b502ce0f4ca57f60d0246121a641cdc7c9397c9746be4b3ebd0db79e1e83b5a |
|
MD5 | f8c9621a22c98226b51e154705f114c8 |
|
BLAKE2b-256 | 2d5d08e0bba7e582e6daddc259d27e0d7f67a91da53b973fe6d5cad14b99144c |