Interface CfnApiPropsMixin.ICorsProperty
The Cors property specifies a CORS configuration for an API.
Namespace: Amazon.CDK.CfnPropertyMixins.AWS.ApiGatewayV2
Assembly: Amazon.CDK.CfnPropertyMixins.dll
Syntax (csharp)
public interface CfnApiPropsMixin.ICorsProperty
Syntax (vb)
Public Interface CfnApiPropsMixin.ICorsProperty
Remarks
Supported only for HTTP APIs. See Configuring CORS for more information.
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.CfnPropertyMixins.AWS.ApiGatewayV2;
var corsProperty = new CorsProperty {
AllowCredentials = false,
AllowHeaders = new [] { "allowHeaders" },
AllowMethods = new [] { "allowMethods" },
AllowOrigins = new [] { "allowOrigins" },
ExposeHeaders = new [] { "exposeHeaders" },
MaxAge = 123
};
Synopsis
Properties
| AllowCredentials | Specifies whether credentials are included in the CORS request. |
| AllowHeaders | Represents a collection of allowed headers. |
| AllowMethods | Represents a collection of allowed HTTP methods. |
| AllowOrigins | Represents a collection of allowed origins. |
| ExposeHeaders | Represents a collection of exposed headers. |
| MaxAge | The number of seconds that the browser should cache preflight request results. |
Properties
AllowCredentials
Specifies whether credentials are included in the CORS request.
object? AllowCredentials { get; }
Property Value
Remarks
Supported only for HTTP APIs.
Type union: either bool or IResolvable
AllowHeaders
Represents a collection of allowed headers.
string[]? AllowHeaders { get; }
Property Value
string[]
Remarks
AllowMethods
Represents a collection of allowed HTTP methods.
string[]? AllowMethods { get; }
Property Value
string[]
Remarks
AllowOrigins
Represents a collection of allowed origins.
string[]? AllowOrigins { get; }
Property Value
string[]
Remarks
ExposeHeaders
Represents a collection of exposed headers.
string[]? ExposeHeaders { get; }
Property Value
string[]
Remarks
MaxAge
The number of seconds that the browser should cache preflight request results.
double? MaxAge { get; }
Property Value
Remarks
Supported only for HTTP APIs.