AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::ApiGateway::RequestValidator

CfnRequestValidator

The `AWS::ApiGateway::RequestValidator` resource sets up basic validation rules for incoming requests to your API. For more information, see [Enable Basic Request Validation for an API in API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-request-validation.html) in the *API Gateway Developer Guide* .

Import

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

Or use the module namespace:

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

Properties

Configuration passed to the constructor as CfnRequestValidatorProps.

restApiIdRequired
string | IRestApiRef

The string identifier of the associated RestApi.

nameOptional
string

The name of this RequestValidator.

validateRequestBodyOptional
boolean | IResolvable

A Boolean flag to indicate whether to validate a request body according to the configured Model schema.

validateRequestParametersOptional
boolean | IResolvable

A Boolean flag to indicate whether to validate request parameters ( `true` ) or not ( `false` ).

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

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