AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::ApiGateway::GatewayResponse

CfnGatewayResponse

The `AWS::ApiGateway::GatewayResponse` resource creates a gateway response for your API. When you delete a stack containing this resource, your custom gateway responses are reset. For more information, see [API Gateway Responses](https://docs.aws.amazon.com/apigateway/latest/developerguide/customize-gateway-responses.html#api-gateway-gatewayResponse-definition) in the *API Gateway Developer Guide* .

Import

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

Or use the module namespace:

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

Properties

Configuration passed to the constructor as CfnGatewayResponseProps.

responseTypeRequired
string

The response type of the associated GatewayResponse.

restApiIdRequired
string | IRestApiRef

The string identifier of the associated RestApi.

responseParametersOptional
{ [key: string]: string } | IResolvable

Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.

responseTemplatesOptional
{ [key: string]: string } | IResolvable

Response templates of the GatewayResponse as a string-to-string map of key-value pairs.

statusCodeOptional
string

The HTTP status code for this GatewayResponse.

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