Interface S3OriginConfig

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
S3OriginConfig.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-17T21:37:27.680Z") @Stability(Stable) public interface S3OriginConfig extends software.amazon.jsii.JsiiSerializable
S3 origin configuration for CloudFront.

Example:

 Bucket sourceBucket;
 ViewerCertificate viewerCertificate = ViewerCertificate.fromIamCertificate("MYIAMROLEIDENTIFIER", ViewerCertificateOptions.builder()
         .aliases(List.of("MYALIAS"))
         .build());
 CloudFrontWebDistribution.Builder.create(this, "MyCfWebDistribution")
         .originConfigs(List.of(SourceConfiguration.builder()
                 .s3OriginSource(S3OriginConfig.builder()
                         .s3BucketSource(sourceBucket)
                         .build())
                 .behaviors(List.of(Behavior.builder().isDefaultBehavior(true).build()))
                 .build()))
         .viewerCertificate(viewerCertificate)
         .build();
 
  • Method Details

    • getS3BucketSource

      @Stability(Stable) @NotNull IBucket getS3BucketSource()
      The source bucket to serve content from.
    • getOriginAccessIdentity

      @Stability(Stable) @Nullable default IOriginAccessIdentity getOriginAccessIdentity()
      The optional Origin Access Identity of the origin identity cloudfront will use when calling your s3 bucket.

      Default: No Origin Access Identity which requires the S3 bucket to be public accessible

    • getOriginHeaders

      @Stability(Stable) @Nullable default Map<String,String> getOriginHeaders()
      Any additional headers to pass to the origin.

      Default: - No additional headers are passed.

    • getOriginPath

      @Stability(Stable) @Nullable default String getOriginPath()
      The relative path to the origin root to use for sources.

      Default: /

    • getOriginShieldRegion

      @Stability(Stable) @Nullable default String getOriginShieldRegion()
      When you enable Origin Shield in the AWS Region that has the lowest latency to your origin, you can get better network performance.

      Default: - origin shield not enabled

    • builder

      @Stability(Stable) static S3OriginConfig.Builder builder()
      Returns:
      a S3OriginConfig.Builder of S3OriginConfig