Interface CfnApi.CorsProperty
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnApi.CorsProperty.Jsii$Proxy
- Enclosing class:
CfnApi
@Stability(Stable)
public static interface CfnApi.CorsProperty
extends software.amazon.jsii.JsiiSerializable
The
Cors property specifies a CORS configuration for an API.
Supported only for HTTP APIs. See Configuring CORS for more information.
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.apigatewayv2.*;
CorsProperty corsProperty = CorsProperty.builder()
.allowCredentials(false)
.allowHeaders(List.of("allowHeaders"))
.allowMethods(List.of("allowMethods"))
.allowOrigins(List.of("allowOrigins"))
.exposeHeaders(List.of("exposeHeaders"))
.maxAge(123)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forCfnApi.CorsPropertystatic final classAn implementation forCfnApi.CorsProperty -
Method Summary
Modifier and TypeMethodDescriptionstatic CfnApi.CorsProperty.Builderbuilder()default ObjectSpecifies whether credentials are included in the CORS request.Represents a collection of allowed headers.Represents a collection of allowed HTTP methods.Represents a collection of allowed origins.Represents a collection of exposed headers.default NumberThe number of seconds that the browser should cache preflight request results.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAllowCredentials
Specifies whether credentials are included in the CORS request.Supported only for HTTP APIs.
Returns union: either
BooleanorIResolvable- See Also:
-
getAllowHeaders
Represents a collection of allowed headers.Supported only for HTTP APIs.
- See Also:
-
getAllowMethods
Represents a collection of allowed HTTP methods.Supported only for HTTP APIs.
- See Also:
-
getAllowOrigins
Represents a collection of allowed origins.Supported only for HTTP APIs.
- See Also:
-
getExposeHeaders
Represents a collection of exposed headers.Supported only for HTTP APIs.
- See Also:
-
getMaxAge
The number of seconds that the browser should cache preflight request results.Supported only for HTTP APIs.
- See Also:
-
builder
- Returns:
- a
CfnApi.CorsProperty.BuilderofCfnApi.CorsProperty
-