AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

GatewayResponse

Configure the response received by clients, produced from the API Gateway backend.

Import

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

Or use the module namespace:

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

Properties

Configuration passed to the constructor as GatewayResponseProps.

restApiRequired
IRestApi

Rest api resource to target.

4 properties inherited from GatewayResponseOptions
typeRequiredinherited from GatewayResponseOptions
ResponseType

Response type to associate with gateway response.

responseHeadersOptionalinherited from GatewayResponseOptions
{ [key: string]: string }

Custom headers parameters for response.

Default: - no headers

statusCodeOptionalinherited from GatewayResponseOptions
string

Http status code for response.

Default: - standard http status code for the response type.

templatesOptionalinherited from GatewayResponseOptions
{ [key: string]: string }

Custom templates to get mapped as response.

Default: - Response from api will be returned without applying any transformation.

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