The CDK Construct Library 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
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 route53.ARecord(self, "AliasRecord", zone=zone, target=route53.RecordTarget.from_alias(alias.ApiGateway(rest_api)) )
-
API Gateway V2 custom domains
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 route53.ARecord(self, "AliasRecord", zone=zone, target=route53.RecordTarget.from_alias(alias.ApiGatewayv2Domain(domain_name)) )
-
CloudFront distributions
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 route53.ARecord(self, "AliasRecord", zone=zone, target=route53.RecordTarget.from_alias(alias.CloudFrontTarget(distribution)) )
-
ELBv2 load balancers
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 route53.ARecord(self, "AliasRecord", zone=zone, target=route53.RecordTarget.from_alias(alias.LoadBalancerTarget(elbv2)) )
-
Classic load balancers
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 route53.ARecord(self, "AliasRecord", zone=zone, target=route53.RecordTarget.from_alias(alias.ClassicLoadBalancerTarget(elb)) )
Important: Based on AWS documentation, all alias record in Route 53 that points to a Elastic Load Balancer will always include dualstack for the DNSName to resolve IPv4/IPv6 addresses (without dualstack IPv6 will not resolve).
For example, if the Amazon-provided DNS for the load balancer is ALB-xxxxxxx.us-west-2.elb.amazonaws.com
, CDK will create alias target in Route 53 will be dualstack.ALB-xxxxxxx.us-west-2.elb.amazonaws.com
.
-
GlobalAccelerator
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 route53.ARecord(stack, "AliasRecord", zone=zone, target=route53.RecordTarget.from_alias(targets.GlobalAcceleratorTarget(accelerator)) )
Important: If you use GlobalAcceleratorDomainTarget, passing a string rather than an instance of IAccelerator, ensure that the string is a valid domain name of an existing Global Accelerator instance. See the documentation on DNS addressing with Global Accelerator for more info.
- InterfaceVpcEndpoints
Important: Based on the CFN docs for VPCEndpoints - see here - the attributes returned for DnsEntries in CloudFormation is a combination of the hosted zone ID and the DNS name. The entries are ordered as follows: regional public DNS, zonal public DNS, private DNS, and wildcard DNS. This order is not enforced for AWS Marketplace services, and therefore this CDK construct is ONLY guaranteed to work with non-marketplace services.
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
route53.ARecord(stack, "AliasRecord",
zone=zone,
target=route53.RecordTarget.from_alias(alias.InterfaceVpcEndpointTarget(interface_vpc_endpoint))
)
- S3 Bucket Website:
Important: The Bucket name must strictly match the full DNS name. See the Developer Guide for more info.
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
[recordName, domainName] = ["www", "example.com"]
bucket_website = Bucket(self, "BucketWebsite",
bucket_name=[record_name, domain_name].join("."), # www.example.com
public_read_access=True,
website_index_document="index.html"
)
zone = HostedZone.from_lookup(self, "Zone", domain_name=domain_name)# example.com
route53.ARecord(self, "AliasRecord",
zone=zone,
record_name=record_name, # www
target=route53.RecordTarget.from_alias(alias.BucketWebsiteTarget(bucket))
)
-
User pool domain
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826 route53.ARecord(self, "AliasRecord", zone=zone, target=route53.RecordTarget.from_alias(alias.UserPoolDomainTarget(domain)) )
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
Hashes for aws-cdk.aws-route53-targets-1.92.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5aac3d89a38c36bb26b3da148e5f12434388ea4bb066d2a27b9e9fc442a4de24 |
|
MD5 | 5592f4c5c4ad1c3db034f24c8a01becd |
|
BLAKE2b-256 | f5e894bf94676b97432eea9f4dfc6f852203c2bb32b52a9eb03f6a0be6bb6df0 |
Hashes for aws_cdk.aws_route53_targets-1.92.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a7e420401f1f8356572f28b0773c2cd2a55a2b94765e8efd21cbe59d38cdc57 |
|
MD5 | 230377113588121d50467dec5c27ab17 |
|
BLAKE2b-256 | 7d75d9be5c02c9bb4508147eb957f6bce7553b10e65056f9ca55221ff6d223e9 |