interface GatewayResponseProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.APIGateway.GatewayResponseProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#GatewayResponseProps |
![]() | software.amazon.awscdk.services.apigateway.GatewayResponseProps |
![]() | aws_cdk.aws_apigateway.GatewayResponseProps |
![]() | 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
Name | Type | Description |
---|---|---|
rest | IRest | Rest api resource to target. |
type | Response | Response type to associate with gateway response. |
response | { [string]: string } | Custom headers parameters for response. |
status | string | Http status code for response. |
templates? | { [string]: string } | Custom templates to get mapped as response. |
restApi
Type:
IRest
Rest api resource to target.
type
Type:
Response
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.