class CloudFrontTarget
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Route53.Targets.CloudFrontTarget |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsroute53targets#CloudFrontTarget |
Java | software.amazon.awscdk.services.route53.targets.CloudFrontTarget |
Python | aws_cdk.aws_route53_targets.CloudFrontTarget |
TypeScript (source) | aws-cdk-lib » aws_route53_targets » CloudFrontTarget |
Implements
IAlias
Use a CloudFront Distribution as an alias record target.
Example
import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
declare const myZone: route53.HostedZone;
declare const distribution: cloudfront.CloudFrontWebDistribution;
new route53.AaaaRecord(this, 'Alias', {
zone: myZone,
target: route53.RecordTarget.fromAlias(new targets.CloudFrontTarget(distribution)),
});
Initializer
new CloudFrontTarget(distribution: IDistribution)
Parameters
- distribution
IDistribution
Properties
| Name | Type | Description |
|---|---|---|
| static CLOUDFRONT_ZONE_ID | string | The hosted zone Id if using an alias record in Route53. |
static CLOUDFRONT_ZONE_ID
Type:
string
The hosted zone Id if using an alias record in Route53.
This value never changes.
Methods
| Name | Description |
|---|---|
| bind(_record, _zone?) | Return hosted zone ID and DNS name, usable for Route53 alias targets. |
| static get | Get the hosted zone id for the current scope. |
bind(_record, _zone?)
public bind(_record: IRecordSet, _zone?: IHostedZone): AliasRecordTargetConfig
Parameters
- _record
IRecordSet - _zone
IHostedZone
Returns
Return hosted zone ID and DNS name, usable for Route53 alias targets.
static getHostedZoneId(scope)
public static getHostedZoneId(scope: IConstruct): string
Parameters
- scope
IConstruct— - scope in which this resource is defined.
Returns
string
Get the hosted zone id for the current scope.

.NET
Go
Java
Python
TypeScript (