GatewayResponseProps Struct
Properties for a new gateway response.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigateway as apigateway } from 'aws-cdk-lib';
declare const responseType: apigateway.ResponseType;
declare const restApi: apigateway.RestApi;
const gatewayResponseProps: apigateway.GatewayResponseProps = {
restApi: restApi,
type: responseType,
// the properties below are optional
responseHeaders: {
responseHeadersKey: 'responseHeaders',
},
statusCode: 'statusCode',
templates: {
templatesKey: 'templates',
},
};
Properties
responseHeadersoptional{ [key: string]: string }response_headersoptionaltyping.Mapping[str, str]responseHeadersoptionalMap<String, String>ResponseHeadersoptionalIDictionary<string, string>ResponseHeadersoptional*map[string]*string#Custom headers parameters for response.
Default: no headers
Rest api resource to target.
statusCodeoptionalstringstatus_codeoptionalstrstatusCodeoptionalStringStatusCodeoptionalstringStatusCodeoptional*string#Http status code for response.
Default: standard http status code for the response type.
templatesoptional{ [key: string]: string }templatesoptionaltyping.Mapping[str, str]templatesoptionalMap<String, String>TemplatesoptionalIDictionary<string, string>Templatesoptional*map[string]*string#Custom templates to get mapped as response.
Default: Response from api will be returned without applying any transformation.
Response type to associate with gateway response.