aws-cdk-lib.aws_apigateway.ResourceOptions

interface ResourceOptions

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

Example

declare const resource: apigateway.Resource;

const subtree = resource.addResource('subtree', {
  defaultCorsPreflightOptions: {
    allowOrigins: [ 'https://amazon.com' ]
  }
});

Properties

NameTypeDescription
defaultCorsPreflightOptions?CorsOptionsAdds a CORS preflight OPTIONS method to this resource and all child resources.
defaultIntegration?IntegrationAn integration to use as a default for all methods created within this API unless an integration is specified.
defaultMethodOptions?MethodOptionsMethod options to use as a default for all methods created within this API unless custom options are specified.

defaultCorsPreflightOptions?

Type: CorsOptions (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: MethodOptions (optional, default: Inherited from parent.)

Method options to use as a default for all methods created within this API unless custom options are specified.