# CorsConfigurationProperty

- Source: Generated at build time
- Type last changed: v2.94.0 · 1 Sep 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 corsConfigurationProperty: sam.CfnFunction.CorsConfigurationProperty = {
  allowOrigin: 'allowOrigin',

  // the properties below are optional
  allowCredentials: false,
  allowHeaders: 'allowHeaders',
  allowMethods: 'allowMethods',
  maxAge: 'maxAge',
};
```

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_property = sam.CfnFunction.CorsConfigurationProperty(
    allow_origin="allowOrigin",

    # the properties below are optional
    allow_credentials=False,
    allow_headers="allowHeaders",
    allow_methods="allowMethods",
    max_age="maxAge"
)
```

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.*;

CorsConfigurationProperty corsConfigurationProperty = CorsConfigurationProperty.builder()
        .allowOrigin("allowOrigin")

        // the properties below are optional
        .allowCredentials(false)
        .allowHeaders("allowHeaders")
        .allowMethods("allowMethods")
        .maxAge("maxAge")
        .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 corsConfigurationProperty = new CorsConfigurationProperty {
    AllowOrigin = "allowOrigin",

    // the properties below are optional
    AllowCredentials = false,
    AllowHeaders = "allowHeaders",
    AllowMethods = "allowMethods",
    MaxAge = "maxAge"
};
```

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"

corsConfigurationProperty := &CorsConfigurationProperty{
	AllowOrigin: jsii.String("allowOrigin"),

	// the properties below are optional
	AllowCredentials: jsii.Boolean(false),
	AllowHeaders: jsii.String("allowHeaders"),
	AllowMethods: jsii.String("allowMethods"),
	MaxAge: jsii.String("maxAge"),
}
```

## Properties

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

- `allowHeaders`: string

- `allowMethods`: string

- `allowOrigin`: string (required)

- `maxAge`: string
