AWS API Gateway V2 Integration Response

This page shows how to write Terraform and CloudFormation for API Gateway V2 Integration Response and write them securely.

aws_apigatewayv2_integration_response (Terraform)

The Integration Response in API Gateway V2 can be configured in Terraform with the resource name aws_apigatewayv2_integration_response. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L7
resource "aws_apigatewayv2_integration_response" "this" {
  api_id                        = var.api_id
  content_handling_strategy     = var.content_handling_strategy
  integration_id                = var.integration_id
  integration_response_key      = var.integration_response_key
  response_templates            = var.response_templates
response.tf#L1
resource "aws_apigatewayv2_integration_response" "publish" {
  api_id                   = var.api_id
  integration_id           = aws_apigatewayv2_integration.publish.id
  integration_response_key = "/200/"
}

response.tf#L1
resource "aws_apigatewayv2_integration_response" "send" {
  api_id                   = var.api_id
  integration_id           = aws_apigatewayv2_integration.send.id
  integration_response_key = "/200/"
}

response.tf#L1
resource "aws_apigatewayv2_integration_response" "hello" {
  api_id                   = var.api_id
  integration_id           = aws_apigatewayv2_integration.ack_presence.id
  integration_response_key = "/200/"
}

response.tf#L1
resource "aws_apigatewayv2_integration_response" "bye" {
  api_id                   = var.api_id
  integration_id           = aws_apigatewayv2_integration.ack_absence.id
  integration_response_key = "/200/"
}

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages an Amazon API Gateway Version 2 integration response. More information can be found in the Amazon API Gateway Developer Guide.

AWS::ApiGatewayV2::IntegrationResponse (CloudFormation)

The IntegrationResponse in ApiGatewayV2 can be configured in CloudFormation with the resource name AWS::ApiGatewayV2::IntegrationResponse. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

Explanation in CloudFormation Registry

The AWS::ApiGatewayV2::IntegrationResponse resource updates an integration response for an WebSocket API. For more information, see Set up WebSocket API Integration Responses in API Gateway in the API Gateway Developer Guide.

Frequently asked questions

What is AWS API Gateway V2 Integration Response?

AWS API Gateway V2 Integration Response is a resource for API Gateway V2 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS API Gateway V2 Integration Response?

For Terraform, the niveklabs/aws, obytes/terraform-aws-sumu and obytes/terraform-aws-sumu source code examples are useful. See the Terraform Example section for further details.