Class CorsRule.Builder

java.lang.Object
software.amazon.awscdk.services.s3.CorsRule.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CorsRule>
Enclosing interface:
CorsRule

@Stability(Stable) public static final class CorsRule.Builder extends Object implements software.amazon.jsii.Builder<CorsRule>
A builder for CorsRule
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • allowedMethods

      @Stability(Stable) public CorsRule.Builder allowedMethods(List<? extends HttpMethods> allowedMethods)
      Parameters:
      allowedMethods - An HTTP method that you allow the origin to execute. This parameter is required.
      Returns:
      this
    • allowedOrigins

      @Stability(Stable) public CorsRule.Builder allowedOrigins(List<String> allowedOrigins)
      Parameters:
      allowedOrigins - One or more origins you want customers to be able to access the bucket from. This parameter is required.
      Returns:
      this
    • allowedHeaders

      @Stability(Stable) public CorsRule.Builder allowedHeaders(List<String> allowedHeaders)
      Parameters:
      allowedHeaders - Headers that are specified in the Access-Control-Request-Headers header.
      Returns:
      this
    • exposedHeaders

      @Stability(Stable) public CorsRule.Builder exposedHeaders(List<String> exposedHeaders)
      Parameters:
      exposedHeaders - One or more headers in the response that you want customers to be able to access from their applications.
      Returns:
      this
    • id

      @Stability(Stable) public CorsRule.Builder id(String id)
      Sets the value of CorsRule.getId()
      Parameters:
      id - A unique identifier for this rule.
      Returns:
      this
    • maxAge

      @Stability(Stable) public CorsRule.Builder maxAge(Number maxAge)
      Sets the value of CorsRule.getMaxAge()
      Parameters:
      maxAge - The time in seconds that your browser is to cache the preflight response for the specified resource.
      Returns:
      this
    • build

      @Stability(Stable) public CorsRule build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<CorsRule>
      Returns:
      a new instance of CorsRule
      Throws:
      NullPointerException - if any required attribute was not provided