Interface CfnBucket.CorsRuleProperty
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnBucket.CorsRuleProperty.Jsii$Proxy
- Enclosing class:
CfnBucket
@Stability(Stable)
public static interface CfnBucket.CorsRuleProperty
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.*;
CorsRuleProperty corsRuleProperty = CorsRuleProperty.builder()
.allowedMethods(List.of("allowedMethods"))
.allowedOrigins(List.of("allowedOrigins"))
// the properties below are optional
.allowedHeaders(List.of("allowedHeaders"))
.exposedHeaders(List.of("exposedHeaders"))
.id("id")
.maxAge(123)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnBucket.CorsRulePropertystatic final classAn implementation forCfnBucket.CorsRuleProperty -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Headers that are specified in theAccess-Control-Request-Headersheader.An HTTP method that you allow the origin to run.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 (for example, from a JavaScriptXMLHttpRequestobject).default StringgetId()A unique identifier for this rule.default NumberThe 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 run.Allowed values :
GET|PUT|HEAD|POST|DELETE- See Also:
-
getAllowedOrigins
One or more origins you want customers to be able to access the bucket from.- See Also:
-
getAllowedHeaders
Headers that are specified in theAccess-Control-Request-Headersheader.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.
- See Also:
-
getExposedHeaders
One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScriptXMLHttpRequestobject).- See Also:
-
getId
A unique identifier for this rule.The value must be no more than 255 characters.
- See Also:
-
getMaxAge
The time in seconds that your browser is to cache the preflight response for the specified resource.- See Also:
-
builder
- Returns:
- a
CfnBucket.CorsRuleProperty.BuilderofCfnBucket.CorsRuleProperty
-