Class CloudFrontTarget

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.route53.targets.CloudFrontTarget
All Implemented Interfaces:
IAliasRecordTarget, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-17T05:10:17.150Z") @Stability(Stable) public class CloudFrontTarget extends software.amazon.jsii.JsiiObject implements IAliasRecordTarget
Use a CloudFront Distribution as an alias record target.

Example:

 import software.amazon.awscdk.services.cloudfront.*;
 HostedZone myZone;
 CloudFrontWebDistribution distribution;
 AaaaRecord.Builder.create(this, "Alias")
         .zone(myZone)
         .target(RecordTarget.fromAlias(new CloudFrontTarget(distribution)))
         .build();
 
  • Field Details

    • CLOUDFRONT_ZONE_ID

      @Stability(Stable) public static final String CLOUDFRONT_ZONE_ID
      The hosted zone Id if using an alias record in Route53.

      This value never changes.

  • Constructor Details

    • CloudFrontTarget

      protected CloudFrontTarget(software.amazon.jsii.JsiiObjectRef objRef)
    • CloudFrontTarget

      protected CloudFrontTarget(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CloudFrontTarget

      @Stability(Stable) public CloudFrontTarget(@NotNull IDistribution distribution)
      Parameters:
      distribution - This parameter is required.
  • Method Details

    • getHostedZoneId

      @Stability(Stable) @NotNull public static String getHostedZoneId(@NotNull software.constructs.IConstruct scope)
      Get the hosted zone id for the current scope.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
    • bind

      @Stability(Stable) @NotNull public AliasRecordTargetConfig bind(@NotNull IRecordSet _record, @Nullable IHostedZone _zone)
      Return hosted zone ID and DNS name, usable for Route53 alias targets.

      Specified by:
      bind in interface IAliasRecordTarget
      Parameters:
      _record - This parameter is required.
      _zone -
    • bind

      @Stability(Stable) @NotNull public AliasRecordTargetConfig bind(@NotNull IRecordSet _record)
      Return hosted zone ID and DNS name, usable for Route53 alias targets.

      Specified by:
      bind in interface IAliasRecordTarget
      Parameters:
      _record - This parameter is required.