Interface CorsRule

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

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:24.114Z") @Stability(Stable) public interface CorsRule extends software.amazon.jsii.JsiiSerializable
Specifies a cross-origin access rule for an Amazon S3 bucket.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.s3.*;
 CorsRule corsRule = CorsRule.builder()
         .allowedMethods(List.of(HttpMethods.GET))
         .allowedOrigins(List.of("allowedOrigins"))
         // the properties below are optional
         .allowedHeaders(List.of("allowedHeaders"))
         .exposedHeaders(List.of("exposedHeaders"))
         .id("id")
         .maxAge(123)
         .build();
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    A builder for CorsRule
    static final class 
    An implementation for CorsRule
  • Method Summary

    Modifier and Type
    Method
    Description
     
    default List<String>
    Headers that are specified in the Access-Control-Request-Headers header.
    An HTTP method that you allow the origin to execute.
    One or more origins you want customers to be able to access the bucket from.
    default List<String>
    One or more headers in the response that you want customers to be able to access from their applications.
    default String
    A unique identifier for this rule.
    default Number
    The time in seconds that your browser is to cache the preflight response for the specified resource.

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Method Details

    • getAllowedMethods

      @Stability(Stable) @NotNull List<HttpMethods> getAllowedMethods()
      An HTTP method that you allow the origin to execute.
    • 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.

      Default: - No headers 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.

      Default: - No headers exposed.

    • getId

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

      Default: - No id specified.

    • getMaxAge

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

      Default: - No caching.

    • builder

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