Interface OriginGroupProps

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

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-22T22:42:48.596Z") @Stability(Stable) public interface OriginGroupProps extends software.amazon.jsii.JsiiSerializable
Construction properties for OriginGroup.

Example:

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

    • getFallbackOrigin

      @Stability(Stable) @NotNull IOrigin getFallbackOrigin()
      The fallback origin that should serve requests when the primary fails.
    • getPrimaryOrigin

      @Stability(Stable) @NotNull IOrigin getPrimaryOrigin()
      The primary origin that should serve requests for this group.
    • getFallbackStatusCodes

      @Stability(Stable) @Nullable default List<Number> getFallbackStatusCodes()
      The list of HTTP status codes that, when returned from the primary origin, would cause querying the fallback origin.

      Default: - 500, 502, 503 and 504

    • builder

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