aws-cdk-lib.aws_route53_targets.CloudFrontTarget

class CloudFrontTarget

LanguageType name
.NETAmazon.CDK.AWS.Route53.Targets.CloudFrontTarget
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsroute53targets#CloudFrontTarget
Javasoftware.amazon.awscdk.services.route53.targets.CloudFrontTarget
Pythonaws_cdk.aws_route53_targets.CloudFrontTarget
TypeScript (source)aws-cdk-lib » aws_route53_targets » CloudFrontTarget

Implements IAliasRecordTarget

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

NameTypeDescription
static CLOUDFRONT_ZONE_IDstringThe 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

NameDescription
bind(_record, _zone?)Return hosted zone ID and DNS name, usable for Route53 alias targets.
static getHostedZoneId(scope)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

  • AliasRecordTargetConfig

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.