aws-cdk-lib.aws_apigateway.Cors

class Cors

LanguageType name
.NETAmazon.CDK.AWS.APIGateway.Cors
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#Cors
Javasoftware.amazon.awscdk.services.apigateway.Cors
Pythonaws_cdk.aws_apigateway.Cors
TypeScript (source)aws-cdk-lib » aws_apigateway » Cors

Example

new apigateway.RestApi(this, 'api', {
  defaultCorsPreflightOptions: {
    allowOrigins: apigateway.Cors.ALL_ORIGINS,
    allowMethods: apigateway.Cors.ALL_METHODS // this is also the default
  }
})

Properties

NameTypeDescription
static ALL_METHODSstring[]All HTTP methods.
static ALL_ORIGINSstring[]All origins.
static DEFAULT_HEADERSstring[]The set of default headers allowed for CORS and useful for API Gateway.

static ALL_METHODS

Type: string[]

All HTTP methods.


static ALL_ORIGINS

Type: string[]

All origins.


static DEFAULT_HEADERS

Type: string[]

The set of default headers allowed for CORS and useful for API Gateway.