CorsConfigurationObjectProperty Struct
| Source | |
|---|---|
| Type last changed |
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sam as sam } from 'aws-cdk-lib';
const corsConfigurationObjectProperty: sam.CfnHttpApi.CorsConfigurationObjectProperty = {
allowCredentials: false,
allowHeaders: ['allowHeaders'],
allowMethods: ['allowMethods'],
allowOrigins: ['allowOrigins'],
exposeHeaders: ['exposeHeaders'],
maxAge: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_sam as sam
cors_configuration_object_property = sam.CfnHttpApi.CorsConfigurationObjectProperty(
allow_credentials=False,
allow_headers=["allowHeaders"],
allow_methods=["allowMethods"],
allow_origins=["allowOrigins"],
expose_headers=["exposeHeaders"],
max_age=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.sam.*;
CorsConfigurationObjectProperty corsConfigurationObjectProperty = CorsConfigurationObjectProperty.builder()
.allowCredentials(false)
.allowHeaders(List.of("allowHeaders"))
.allowMethods(List.of("allowMethods"))
.allowOrigins(List.of("allowOrigins"))
.exposeHeaders(List.of("exposeHeaders"))
.maxAge(123)
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.SAM;
var corsConfigurationObjectProperty = new CorsConfigurationObjectProperty {
AllowCredentials = false,
AllowHeaders = new [] { "allowHeaders" },
AllowMethods = new [] { "allowMethods" },
AllowOrigins = new [] { "allowOrigins" },
ExposeHeaders = new [] { "exposeHeaders" },
MaxAge = 123
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
corsConfigurationObjectProperty := &CorsConfigurationObjectProperty{
AllowCredentials: jsii.Boolean(false),
AllowHeaders: []*string{
jsii.String("allowHeaders"),
},
AllowMethods: []*string{
jsii.String("allowMethods"),
},
AllowOrigins: []*string{
jsii.String("allowOrigins"),
},
ExposeHeaders: []*string{
jsii.String("exposeHeaders"),
},
MaxAge: jsii.Number(123),
}
Properties
allowCredentialsoptionalboolean | IResolvableallow_credentialsoptionaltyping.Union[bool, IResolvable]allowCredentialsoptionalBooleanAllowCredentialsoptionalboolAllowCredentialsoptionalinterface{} #allowHeadersoptionalstring[]allow_headersoptionaltyping.List[str]allowHeadersoptionalList<String>AllowHeadersoptionalstring[]AllowHeadersoptional*[]*string #allowMethodsoptionalstring[]allow_methodsoptionaltyping.List[str]allowMethodsoptionalList<String>AllowMethodsoptionalstring[]AllowMethodsoptional*[]*string #allowOriginsoptionalstring[]allow_originsoptionaltyping.List[str]allowOriginsoptionalList<String>AllowOriginsoptionalstring[]AllowOriginsoptional*[]*string #exposeHeadersoptionalstring[]expose_headersoptionaltyping.List[str]exposeHeadersoptionalList<String>ExposeHeadersoptionalstring[]ExposeHeadersoptional*[]*string #maxAgeoptionalnumbermax_ageoptionalint | floatmaxAgeoptionalNumberMaxAgeoptionaldoubleMaxAgeoptional*float64 #