aws-cdk-lib.aws_apigateway.ProxyResourceOptions

interface ProxyResourceOptions

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

Example

declare const resource: apigateway.Resource;
declare const handler: lambda.Function;
const proxy = resource.addProxy({
  defaultIntegration: new apigateway.LambdaIntegration(handler),

  // "false" will require explicitly adding methods on the `proxy` resource
  anyMethod: true // "true" is the default
});

Properties

NameTypeDescription
anyMethod?booleanAdds an "ANY" method to this resource.
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.

anyMethod?

Type: boolean (optional, default: true)

Adds an "ANY" method to this resource.

If set to false, you will have to explicitly add methods to this resource after it's created.


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.