CloudFrontTarget

class aws_cdk.aws_route53_targets.CloudFrontTarget(distribution)

Bases: object

Use a CloudFront Distribution as an alias record target.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_cloudfront as cloudfront

# my_zone: route53.HostedZone
# distribution: cloudfront.CloudFrontWebDistribution

route53.AaaaRecord(self, "Alias",
    zone=my_zone,
    target=route53.RecordTarget.from_alias(targets.CloudFrontTarget(distribution))
)
Parameters:

distribution (IDistribution) –

Methods

bind(_record, _zone=None)

Return hosted zone ID and DNS name, usable for Route53 alias targets.

Parameters:
Return type:

AliasRecordTargetConfig

Attributes

CLOUDFRONT_ZONE_ID = 'Z2FDTNDATAQYW2'

Static Methods

classmethod get_hosted_zone_id(scope)

Get the hosted zone id for the current scope.

Parameters:

scope (IConstruct) –

  • scope in which this resource is defined.

Return type:

str