# CorsConfigurationObjectProperty

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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
};
```

Golang:

```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

- `allowCredentials`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html)

- `allowHeaders`: string[]

- `allowMethods`: string[]

- `allowOrigins`: string[]

- `exposeHeaders`: string[]

- `maxAge`: number
