See: Description
| Class | Description |
|---|---|
| ApiGateway |
(experimental) Defines an API Gateway REST API as the alias target.
|
| ApiGatewayDomain |
(experimental) Defines an API Gateway domain name as the alias target.
|
| ApiGatewayv2DomainProperties |
(experimental) Defines an API Gateway V2 domain name as the alias target.
|
| BucketWebsiteTarget |
(experimental) Use a S3 as an alias record target.
|
| ClassicLoadBalancerTarget |
(experimental) Use a classic ELB as an alias record target.
|
| CloudFrontTarget |
(experimental) Use a CloudFront Distribution as an alias record target.
|
| GlobalAcceleratorDomainTarget |
(experimental) Use a Global Accelerator domain name as an alias record target.
|
| GlobalAcceleratorTarget |
(experimental) Use a Global Accelerator instance domain name as an alias record target.
|
| InterfaceVpcEndpointTarget |
(experimental) Set an InterfaceVpcEndpoint as a target for an ARecord.
|
| LoadBalancerTarget |
(experimental) Use an ELBv2 as an alias record target.
|
| UserPoolDomainTarget |
(experimental) Use a user pool domain as an alias record target.
|
---
This library contains Route53 Alias Record targets for:
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
ARecord.Builder.create(this, "AliasRecord")
.zone(zone)
.target(route53.RecordTarget.fromAlias(new ApiGateway(restApi)))
.build();
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
ARecord.Builder.create(this, "AliasRecord")
.zone(zone)
.target(route53.RecordTarget.fromAlias(new ApiGatewayv2DomainProperties(domainName.getRegionalDomainName(), domainName.getRegionalHostedZoneId())))
.build();
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
ARecord.Builder.create(this, "AliasRecord")
.zone(zone)
.target(route53.RecordTarget.fromAlias(new CloudFrontTarget(distribution)))
.build();
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
ARecord.Builder.create(this, "AliasRecord")
.zone(zone)
.target(route53.RecordTarget.fromAlias(new LoadBalancerTarget(elbv2)))
.build();
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
ARecord.Builder.create(this, "AliasRecord")
.zone(zone)
.target(route53.RecordTarget.fromAlias(new ClassicLoadBalancerTarget(elb)))
.build();
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.
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
ARecord.Builder.create(stack, "AliasRecord")
.zone(zone)
.target(route53.RecordTarget.fromAlias(new GlobalAcceleratorTarget(accelerator)))
.build();
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.
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
ARecord.Builder.create(stack, "AliasRecord")
.zone(zone)
.target(route53.RecordTarget.fromAlias(new InterfaceVpcEndpointTarget(interfaceVpcEndpoint)))
.build();
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
Object [recordName, domainName] = asList("www", "example.com");
Object bucketWebsite = Bucket.Builder.create(this, "BucketWebsite")
.bucketName([recordName, domainName].join("."))// www.example.com
.publicReadAccess(true)
.websiteIndexDocument("index.html")
.build();
Object zone = HostedZone.fromLookup(this, "Zone", Map.of("domainName", domainName));// example.com
// example.com
ARecord.Builder.create(this, "AliasRecord")
.zone(zone)
.recordName(recordName)// www
.target(route53.RecordTarget.fromAlias(new BucketWebsiteTarget(bucket)))
.build();
// Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
ARecord.Builder.create(this, "AliasRecord")
.zone(zone)
.target(route53.RecordTarget.fromAlias(new UserPoolDomainTarget(domain)))
.build();
See the documentation of @aws-cdk/aws-route53 for more information.
Copyright © 2021. All rights reserved.