java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.cloudfront.OriginBase
software.amazon.awscdk.services.cloudfront.origins.S3BucketOrigin
All Implemented Interfaces:
IOrigin, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-17T21:37:27.718Z") @Stability(Stable) public abstract class S3BucketOrigin extends OriginBase
A S3 Bucket Origin.

Example:

 Bucket myBucket = new Bucket(this, "myBucket");
 Distribution.Builder.create(this, "myDist")
         .defaultBehavior(BehaviorOptions.builder()
                 .origin(OriginGroup.Builder.create()
                         .primaryOrigin(S3BucketOrigin.withOriginAccessControl(myBucket))
                         .fallbackOrigin(new HttpOrigin("www.example.com"))
                         // optional, defaults to: 500, 502, 503 and 504
                         .fallbackStatusCodes(List.of(404))
                         .build())
                 .build())
         .build();
 
  • Constructor Details

    • S3BucketOrigin

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

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

      @Stability(Stable) protected S3BucketOrigin(@NotNull IBucket bucket, @Nullable S3BucketOriginBaseProps props)
      Parameters:
      bucket - This parameter is required.
      props -
    • S3BucketOrigin

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

    • withBucketDefaults

      @Stability(Stable) @NotNull public static IOrigin withBucketDefaults(@NotNull IBucket bucket, @Nullable OriginProps props)
      Create a S3 Origin with default S3 bucket settings (no origin access control).

      Parameters:
      bucket - This parameter is required.
      props -
    • withBucketDefaults

      @Stability(Stable) @NotNull public static IOrigin withBucketDefaults(@NotNull IBucket bucket)
      Create a S3 Origin with default S3 bucket settings (no origin access control).

      Parameters:
      bucket - This parameter is required.
    • withOriginAccessControl

      @Stability(Stable) @NotNull public static IOrigin withOriginAccessControl(@NotNull IBucket bucket, @Nullable S3BucketOriginWithOACProps props)
      Create a S3 Origin with Origin Access Control (OAC) configured.

      Parameters:
      bucket - This parameter is required.
      props -
    • withOriginAccessControl

      @Stability(Stable) @NotNull public static IOrigin withOriginAccessControl(@NotNull IBucket bucket)
      Create a S3 Origin with Origin Access Control (OAC) configured.

      Parameters:
      bucket - This parameter is required.
    • withOriginAccessIdentity

      @Stability(Stable) @NotNull public static IOrigin withOriginAccessIdentity(@NotNull IBucket bucket, @Nullable S3BucketOriginWithOAIProps props)
      Create a S3 Origin with Origin Access Identity (OAI) configured OAI is a legacy feature and we strongly recommend you to use OAC via withOriginAccessControl() unless it is not supported in your required region (e.g. China regions).

      Parameters:
      bucket - This parameter is required.
      props -
    • withOriginAccessIdentity

      @Stability(Stable) @NotNull public static IOrigin withOriginAccessIdentity(@NotNull IBucket bucket)
      Create a S3 Origin with Origin Access Identity (OAI) configured OAI is a legacy feature and we strongly recommend you to use OAC via withOriginAccessControl() unless it is not supported in your required region (e.g. China regions).

      Parameters:
      bucket - This parameter is required.
    • renderS3OriginConfig

      @Stability(Stable) @Nullable protected CfnDistribution.S3OriginConfigProperty renderS3OriginConfig()
      Overrides:
      renderS3OriginConfig in class OriginBase