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

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:13.797Z") @Stability(Stable) public class S3Origin extends software.amazon.jsii.JsiiObject implements IOrigin
An Origin that is backed by an S3 bucket.

If the bucket is configured for website hosting, this origin will be configured to use the bucket as an HTTP server origin and will use the bucket's configured website redirects and error handling. Otherwise, the origin is created as a bucket origin and will use CloudFront's redirect and error handling.

Example:

 // Adding an existing Lambda@Edge function created in a different stack
 // to a CloudFront distribution.
 Bucket s3Bucket;
 IVersion functionVersion = Version.fromVersionArn(this, "Version", "arn:aws:lambda:us-east-1:123456789012:function:functionName:1");
 Distribution.Builder.create(this, "distro")
         .defaultBehavior(BehaviorOptions.builder()
                 .origin(new S3Origin(s3Bucket))
                 .edgeLambdas(List.of(EdgeLambda.builder()
                         .functionVersion(functionVersion)
                         .eventType(LambdaEdgeEventType.VIEWER_REQUEST)
                         .build()))
                 .build())
         .build();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A fluent builder for S3Origin.

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.amazon.awscdk.services.cloudfront.IOrigin

    IOrigin.Jsii$Default, IOrigin.Jsii$Proxy
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    S3Origin(IBucket bucket)
     
     
    S3Origin(IBucket bucket, S3OriginProps props)
     
    protected
    S3Origin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    S3Origin(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    bind(software.constructs.Construct scope, OriginBindOptions options)
    The method called when a given Origin is added (for the first time) to a Distribution.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • S3Origin

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

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

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

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

    • bind

      @Stability(Stable) @NotNull public OriginBindConfig bind(@NotNull software.constructs.Construct scope, @NotNull OriginBindOptions options)
      The method called when a given Origin is added (for the first time) to a Distribution.

      Specified by:
      bind in interface IOrigin
      Parameters:
      scope - This parameter is required.
      options - This parameter is required.