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.12.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42b0b9cc358bb62df932eb6d02701c4c655713e1994606f9b3887b888001eb9d |
|
MD5 | b0b10104a6f4036945aa26b29a182d6a |
|
BLAKE2b-256 | 56f3b6f96f3408a90c7e6d9079cdeb368adb917f7c60bd53edc3de3b4a1fdba1 |
Close
Hashes for aws_cdk.aws_route53_targets-1.12.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd64a7a35b9a5c5d6c331d77bb7784bf8bc7426e1f75669997afc57953e3b4eb |
|
MD5 | 17d4a22b4642871854773f5aac206fbf |
|
BLAKE2b-256 | 1716e84c77b7ce7a3ecfc8c1a245aee51402273abb843986d455f72b825020d7 |