Class BucketWebsiteTarget

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

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-27T17:02:09.236Z") @Stability(Stable) public class BucketWebsiteTarget extends software.amazon.jsii.JsiiObject implements IAliasRecordTarget
Use a S3 as an alias record target.

Example:

 import software.amazon.awscdk.services.s3.*;
 String recordName = "www";
 String domainName = "example.com";
 Bucket bucketWebsite = Bucket.Builder.create(this, "BucketWebsite")
         .bucketName(List.of(recordName, domainName).join(".")) // www.example.com
         .publicReadAccess(true)
         .websiteIndexDocument("index.html")
         .build();
 IHostedZone zone = HostedZone.fromLookup(this, "Zone", HostedZoneProviderProps.builder().domainName(domainName).build()); // example.com
  // example.com
 ARecord.Builder.create(this, "AliasRecord")
         .zone(zone)
         .recordName(recordName) // www
         .target(RecordTarget.fromAlias(
         new BucketWebsiteTarget(bucketWebsite, Map.of(
                 "evaluateTargetHealth", true))))
         .build();
 
  • Constructor Details

    • BucketWebsiteTarget

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

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

      @Stability(Stable) public BucketWebsiteTarget(@NotNull IBucket bucket, @Nullable IAliasRecordTargetProps props)
      Parameters:
      bucket - This parameter is required.
      props -
    • BucketWebsiteTarget

      @Stability(Stable) public BucketWebsiteTarget(@NotNull IBucket bucket)
      Parameters:
      bucket - This parameter is required.
  • Method Details