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
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
resource "aws_apigatewayv2_integration_response" "publish" {
api_id = var.api_id
integration_id = aws_apigatewayv2_integration.publish.id
integration_response_key = "/200/"
}
resource "aws_apigatewayv2_integration_response" "send" {
api_id = var.api_id
integration_id = aws_apigatewayv2_integration.send.id
integration_response_key = "/200/"
}
resource "aws_apigatewayv2_integration_response" "hello" {
api_id = var.api_id
integration_id = aws_apigatewayv2_integration.ack_presence.id
integration_response_key = "/200/"
}
resource "aws_apigatewayv2_integration_response" "bye" {
api_id = var.api_id
integration_id = aws_apigatewayv2_integration.ack_absence.id
integration_response_key = "/200/"
}
Parameters
-
api_id
required - string -
content_handling_strategy
optional - string -
id
optional computed - string -
integration_id
required - string -
integration_response_key
required - string -
response_templates
optional - map from string to string -
template_selection_expression
optional - string
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
-
ResponseTemplates
optional - Json -
TemplateSelectionExpression
optional - String -
ResponseParameters
optional - Json -
ContentHandlingStrategy
optional - String -
IntegrationId
required - String -
IntegrationResponseKey
required - String -
ApiId
required - String
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.