# CfnGatewayResponseProps

Properties for defining a `CfnGatewayResponse`.

Used as props by: [CfnGatewayResponse](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.CfnGatewayResponse.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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"
};
```

Golang:

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

- `responseParameters`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | { [key: string]: string } — Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.

- `responseTemplates`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | { [key: string]: string } — Response templates of the GatewayResponse as a string-to-string map of key-value pairs.

- `responseType`: string (required) — The response type of the associated GatewayResponse.

- `restApiId`: string | [IRestApiRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_apigateway.IRestApiRef.html) (required) — The string identifier of the associated RestApi.

- `statusCode`: string — The HTTP status code for this GatewayResponse.
