Resource: aws_apigatewayv2_route_response

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

Example Usage

Basic

resource "aws_apigatewayv2_route_response" "example" {
  api_id             = aws_apigatewayv2_api.example.id
  route_id           = aws_apigatewayv2_route.example.id
  route_response_key = "$default"
}

Enabling Two-Way Communication

For websocket routes that require two-way communication enabled, an aws_apigatewayv2_route_response needs to be added to the route with route_response_key = "$default". More information available is available in Amazon API Gateway Developer Guide.

You can only define the $default route response for WebSocket APIs. You can use an integration response to manipulate the response from a backend service. For more information, see Overview of integration responses.

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import aws_apigatewayv2_route_response using the API identifier, route identifier and route response identifier. For example:

import {
  to = aws_apigatewayv2_route_response.example
  id = "aabbccddee/1122334/998877"
}

Using terraform import, import aws_apigatewayv2_route_response using the API identifier, route identifier and route response identifier. For example:

% terraform import aws_apigatewayv2_route_response.example aabbccddee/1122334/998877