Interface OriginOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
FunctionUrlOriginProps, HttpOriginProps, LoadBalancerV2OriginProps, OriginProps, RestApiOriginProps, S3BucketOriginBaseProps, S3BucketOriginWithOACProps, S3BucketOriginWithOAIProps, S3OriginProps, S3StaticWebsiteOriginProps
All Known Implementing Classes:
FunctionUrlOriginProps.Jsii$Proxy, HttpOriginProps.Jsii$Proxy, LoadBalancerV2OriginProps.Jsii$Proxy, OriginOptions.Jsii$Proxy, OriginProps.Jsii$Proxy, RestApiOriginProps.Jsii$Proxy, S3BucketOriginBaseProps.Jsii$Proxy, S3BucketOriginWithOACProps.Jsii$Proxy, S3BucketOriginWithOAIProps.Jsii$Proxy, S3OriginProps.Jsii$Proxy, S3StaticWebsiteOriginProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-05T03:43:40.022Z") @Stability(Stable) public interface OriginOptions extends software.amazon.jsii.JsiiSerializable
Options to define an Origin.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 import software.amazon.awscdk.services.cloudfront.*;
 OriginOptions originOptions = OriginOptions.builder()
         .connectionAttempts(123)
         .connectionTimeout(Duration.minutes(30))
         .customHeaders(Map.of(
                 "customHeadersKey", "customHeaders"))
         .originAccessControlId("originAccessControlId")
         .originId("originId")
         .originShieldEnabled(false)
         .originShieldRegion("originShieldRegion")
         .build();
 
  • Method Details

    • getConnectionAttempts

      @Stability(Stable) @Nullable default Number getConnectionAttempts()
      The number of times that CloudFront attempts to connect to the origin;

      valid values are 1, 2, or 3 attempts.

      Default: 3

    • getConnectionTimeout

      @Stability(Stable) @Nullable default Duration getConnectionTimeout()
      The number of seconds that CloudFront waits when trying to establish a connection to the origin.

      Valid values are 1-10 seconds, inclusive.

      Default: Duration.seconds(10)

    • getCustomHeaders

      @Stability(Stable) @Nullable default Map<String,String> getCustomHeaders()
      A list of HTTP header names and values that CloudFront adds to requests it sends to the origin.

      Default: {}

    • getOriginAccessControlId

      @Stability(Stable) @Nullable default String getOriginAccessControlId()
      The unique identifier of an origin access control for this origin.

      Default: - no origin access control

    • getOriginId

      @Stability(Stable) @Nullable default String getOriginId()
      A unique identifier for the origin.

      This value must be unique within the distribution.

      Default: - an originid will be generated for you

    • getOriginShieldEnabled

      @Stability(Stable) @Nullable default Boolean getOriginShieldEnabled()
      Origin Shield is enabled by setting originShieldRegion to a valid region, after this to disable Origin Shield again you must set this flag to false.

      Default: - true

    • 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

      See Also:
    • builder

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