Interface CorsRule
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CorsRule.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:37.672Z")
@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
-
Method Summary
Modifier and TypeMethodDescriptionstatic CorsRule.Builder
builder()
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.One or more headers in the response that you want customers to be able to access from their applications.default String
getId()
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
An HTTP method that you allow the origin to execute. -
getAllowedOrigins
One or more origins you want customers to be able to access the bucket from. -
getAllowedHeaders
Headers that are specified in the Access-Control-Request-Headers header.Default: - No headers allowed.
-
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
A unique identifier for this rule.Default: - No id specified.
-
getMaxAge
The time in seconds that your browser is to cache the preflight response for the specified resource.Default: - No caching.
-
builder
- Returns:
- a
CorsRule.Builder
ofCorsRule
-