AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

Method

Import

import { Method } from 'aws-cdk-lib/aws-apigateway';

Or use the module namespace:

import * as apigateway from 'aws-cdk-lib/aws-apigateway';
// apigateway.Method

Properties

Configuration passed to the constructor as MethodProps.

httpMethodRequired
string

The HTTP method ("GET", "POST", "PUT", ...) that clients use to call this method.

resourceRequired
IResource

The resource this method is associated with. For root resource methods, specify the `RestApi` object.

integrationOptional
Integration

The backend system that the method calls when it receives a request.

Default: - a new `MockIntegration`.

optionsOptional
MethodOptions

Method options.

Default: - No options.

Get the Amazon API Gateway Cheat Sheet

Everything you need to know about Amazon API Gateway on one page. HD quality, print-friendly.

Download Free Infographic