From edd630e1e53b51a729ba416fd5de033a5d0c2fc7 Mon Sep 17 00:00:00 2001 From: Gary Tempus Jr Date: Tue, 18 Oct 2022 15:38:00 -0400 Subject: [PATCH] :sparkles: feat(Pagination): Mention pagination on timeout Adding a response template for an INTEGRATION_TIMEOUT that informs users of the pagination query params. Resources: - https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-gateway-response-using-the-api.html - https://docs.aws.amazon.com/apigateway/latest/api/API_GatewayResponse.html#responseType - https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_gateway_response#response_type --- terraform/modules/api_gateway/resource/main.tf | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/terraform/modules/api_gateway/resource/main.tf b/terraform/modules/api_gateway/resource/main.tf index aeb434025..b8cb9b10e 100644 --- a/terraform/modules/api_gateway/resource/main.tf +++ b/terraform/modules/api_gateway/resource/main.tf @@ -83,4 +83,19 @@ resource "aws_api_gateway_gateway_response" "throttled" { response_templates = { "application/json" = "{\"status\":\"failed\",\"message\":\"Exceeded the rate limit for this resource. Please try again later.\"}" } -} \ No newline at end of file +} + +resource "aws_api_gateway_gateway_response" "integration_timeout" { + rest_api_id = var.rest_api_id + status_code = "504" + response_type = "INTEGRATION_TIMEOUT" + + response_templates = { + "application/json" = <