# CloudFrontTarget

Use a CloudFront Distribution as an alias record target.

Extends: CloudFrontTarget
Implements: IAliasRecordTarget

- Source: [`aws-route53-targets/lib/cloudfront-target.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-route53-targets/lib/cloudfront-target.ts#L9)

## Example

```ts
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

```ts
new CloudFrontTarget(distribution: IDistribution)
```

## Properties

- `CLOUDFRONT_ZONE_ID`: string (static) — The hosted zone Id if using an alias record in Route53.

  This value never changes.

## Methods

- `bind(_record: IRecordSet, _zone?: IHostedZone): AliasRecordTargetConfig` — Return hosted zone ID and DNS name, usable for Route53 alias targets.

- `getHostedZoneId(scope: IConstruct): string` (static) — Get the hosted zone id for the current scope.

  **Parameters**

  - `scope` — - scope in which this resource is defined.
