class CloudFrontTarget
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Route53.Targets.CloudFrontTarget |
Java | software.amazon.awscdk.services.route53.targets.CloudFrontTarget |
Python | aws_cdk.aws_route53_targets.CloudFrontTarget |
TypeScript (source) | @aws-cdk/aws-route53-targets » CloudFrontTarget |
Implements
IAlias
Use a CloudFront Distribution as an alias record target.
Example
import * as cloudfront from '@aws-cdk/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
IRecord
Set - _zone
IHosted
Zone
Returns
Return hosted zone ID and DNS name, usable for Route53 alias targets.
HostedZoneId(scope)
static getpublic 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.