Interface CfnBucket.CorsRuleProperty

All Superinterfaces:
All Known Implementing Classes:
Enclosing class:

@Stability(Stable) public static interface CfnBucket.CorsRuleProperty extends
Specifies a cross-origin access rule for an Amazon S3 bucket.


 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 CorsRuleProperty corsRuleProperty = CorsRuleProperty.builder()
         // the properties below are optional
  • Method Details

    • getAllowedMethods

      @Stability(Stable) @NotNull List<String> getAllowedMethods()
      An HTTP method that you allow the origin to run.

      Allowed values : GET | PUT | HEAD | POST | DELETE

    • getAllowedOrigins

      @Stability(Stable) @NotNull List<String> getAllowedOrigins()
      One or more origins you want customers to be able to access the bucket from.
    • getAllowedHeaders

      @Stability(Stable) @Nullable default List<String> getAllowedHeaders()
      Headers that are specified in the Access-Control-Request-Headers header.

      These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.

    • getExposedHeaders

      @Stability(Stable) @Nullable default List<String> getExposedHeaders()
      One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).
    • getId

      @Stability(Stable) @Nullable default String getId()
      A unique identifier for this rule.

      The value must be no more than 255 characters.

    • getMaxAge

      @Stability(Stable) @Nullable default Number getMaxAge()
      The time in seconds that your browser is to cache the preflight response for the specified resource.
    • builder

      @Stability(Stable) static CfnBucket.CorsRuleProperty.Builder builder()
      a CfnBucket.CorsRuleProperty.Builder of CfnBucket.CorsRuleProperty