Skip to content
v2.278.0

CfnGatewayResponseProps Struct ​

Properties for defining a CfnGatewayResponse.

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';
const cfnGatewayResponseProps: apigateway.CfnGatewayResponseProps = {
  responseType: 'responseType',
  restApiId: 'restApiId',

  // the properties below are optional
  responseParameters: {
    responseParametersKey: 'responseParameters',
  },
  responseTemplates: {
    responseTemplatesKey: 'responseTemplates',
  },
  statusCode: 'statusCode',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_apigateway as apigateway

cfn_gateway_response_props = apigateway.CfnGatewayResponseProps(
    response_type="responseType",
    rest_api_id="restApiId",

    # the properties below are optional
    response_parameters={
        "response_parameters_key": "responseParameters"
    },
    response_templates={
        "response_templates_key": "responseTemplates"
    },
    status_code="statusCode"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.apigateway.*;

CfnGatewayResponseProps cfnGatewayResponseProps = CfnGatewayResponseProps.builder()
        .responseType("responseType")
        .restApiId("restApiId")

        // the properties below are optional
        .responseParameters(Map.of(
                "responseParametersKey", "responseParameters"))
        .responseTemplates(Map.of(
                "responseTemplatesKey", "responseTemplates"))
        .statusCode("statusCode")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APIGateway;

var cfnGatewayResponseProps = new CfnGatewayResponseProps {
    ResponseType = "responseType",
    RestApiId = "restApiId",

    // the properties below are optional
    ResponseParameters = new Dictionary<string, string> {
        { "responseParametersKey", "responseParameters" }
    },
    ResponseTemplates = new Dictionary<string, string> {
        { "responseTemplatesKey", "responseTemplates" }
    },
    StatusCode = "statusCode"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnGatewayResponseProps := &CfnGatewayResponseProps{
	ResponseType: jsii.String("responseType"),
	RestApiId: jsii.String("restApiId"),

	// the properties below are optional
	ResponseParameters: map[string]*string{
		"responseParametersKey": jsii.String("responseParameters"),
	},
	ResponseTemplates: map[string]*string{
		"responseTemplatesKey": jsii.String("responseTemplates"),
	},
	StatusCode: jsii.String("statusCode"),
}

Properties ​

responseParametersoptionalIResolvable | { [key: string]: string }response_parametersoptionaltyping.Union[IResolvable, typing.Mapping[str, str]]responseParametersoptionalIResolvableResponseParametersoptionalIResolvableResponseParametersoptionalinterface{} #
Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.
responseTemplatesoptionalIResolvable | { [key: string]: string }response_templatesoptionaltyping.Union[IResolvable, typing.Mapping[str, str]]responseTemplatesoptionalIResolvableResponseTemplatesoptionalIResolvableResponseTemplatesoptionalinterface{} #
Response templates of the GatewayResponse as a string-to-string map of key-value pairs.
responseTypestringresponse_typestrresponseTypeStringResponseTypestringResponseType*string required #
The response type of the associated GatewayResponse.
restApiIdstring | IRestApiRefrest_api_idtyping.Union[str, IRestApiRef]restApiIdStringRestApiIdstringRestApiIdinterface{} required #
The string identifier of the associated RestApi.
statusCodeoptionalstringstatus_codeoptionalstrstatusCodeoptionalStringStatusCodeoptionalstringStatusCodeoptional*string #
The HTTP status code for this GatewayResponse.