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.103.1 (build bef2dea)", date="2024-10-25T14:21:22.745Z") @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)))
         .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)
      Parameters:
      bucket - This parameter is required.
  • Method Details