interface ResourceOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.APIGateway.ResourceOptions |
Java | software.amazon.awscdk.services.apigateway.ResourceOptions |
Python | aws_cdk.aws_apigateway.ResourceOptions |
TypeScript (source) | @aws-cdk/aws-apigateway » ResourceOptions |
Example
declare const resource: apigateway.Resource;
const subtree = resource.addResource('subtree', {
defaultCorsPreflightOptions: {
allowOrigins: [ 'https://amazon.com' ]
}
});
Properties
| Name | Type | Description |
|---|---|---|
| default | Cors | Adds a CORS preflight OPTIONS method to this resource and all child resources. |
| default | Integration | An integration to use as a default for all methods created within this API unless an integration is specified. |
| default | Method | Method options to use as a default for all methods created within this API unless custom options are specified. |
defaultCorsPreflightOptions?
Type:
Cors
(optional, default: CORS is disabled)
Adds a CORS preflight OPTIONS method to this resource and all child resources.
You can add CORS at the resource-level using addCorsPreflight.
defaultIntegration?
Type:
Integration
(optional, default: Inherited from parent.)
An integration to use as a default for all methods created within this API unless an integration is specified.
defaultMethodOptions?
Type:
Method
(optional, default: Inherited from parent.)
Method options to use as a default for all methods created within this API unless custom options are specified.

.NET
Java
Python
TypeScript (