aws-cdk-lib.aws_apigateway.GatewayResponseProps

interface GatewayResponseProps

LanguageType name
.NETAmazon.CDK.AWS.APIGateway.GatewayResponseProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#GatewayResponseProps
Javasoftware.amazon.awscdk.services.apigateway.GatewayResponseProps
Pythonaws_cdk.aws_apigateway.GatewayResponseProps
TypeScript (source)aws-cdk-lib » aws_apigateway » GatewayResponseProps

Properties for a new gateway response.

Example

// 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

NameTypeDescription
restApiIRestApiRest api resource to target.
typeResponseTypeResponse type to associate with gateway response.
responseHeaders?{ [string]: string }Custom headers parameters for response.
statusCode?stringHttp status code for response.
templates?{ [string]: string }Custom templates to get mapped as response.

restApi

Type: IRestApi

Rest api resource to target.


type

Type: ResponseType

Response type to associate with gateway response.

See also: https://docs.aws.amazon.com/apigateway/latest/developerguide/supported-gateway-response-types.html


responseHeaders?

Type: { [string]: string } (optional, default: no headers)

Custom headers parameters for response.


statusCode?

Type: string (optional, default: standard http status code for the response type.)

Http status code for response.


templates?

Type: { [string]: string } (optional, default: Response from api will be returned without applying any transformation.)

Custom templates to get mapped as response.