diff --git a/aws/resource_aws_apigatewayv2_integration.go b/aws/resource_aws_apigatewayv2_integration.go index a2bc1c28b07..be5ed63328e 100644 --- a/aws/resource_aws_apigatewayv2_integration.go +++ b/aws/resource_aws_apigatewayv2_integration.go @@ -124,10 +124,9 @@ func resourceAwsApiGatewayV2Integration() *schema.Resource { Optional: true, }, "timeout_milliseconds": { - Type: schema.TypeInt, - Optional: true, - Default: 29000, - ValidateFunc: validation.IntBetween(50, 29000), + Type: schema.TypeInt, + Optional: true, + Computed: true, }, "tls_config": { Type: schema.TypeList, diff --git a/aws/resource_aws_apigatewayv2_integration_test.go b/aws/resource_aws_apigatewayv2_integration_test.go index 524bf6774de..6ff3061b65e 100644 --- a/aws/resource_aws_apigatewayv2_integration_test.go +++ b/aws/resource_aws_apigatewayv2_integration_test.go @@ -84,7 +84,7 @@ func TestAccAWSAPIGatewayV2Integration_basicHttp(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "payload_format_version", "1.0"), resource.TestCheckResourceAttr(resourceName, "request_templates.%", "0"), resource.TestCheckResourceAttr(resourceName, "template_selection_expression", ""), - resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "29000"), + resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "30000"), ), }, { @@ -267,7 +267,7 @@ func TestAccAWSAPIGatewayV2Integration_LambdaHttp(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "request_parameters.%", "0"), resource.TestCheckResourceAttr(resourceName, "request_templates.%", "0"), resource.TestCheckResourceAttr(resourceName, "template_selection_expression", ""), - resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "29000"), + resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "30000"), resource.TestCheckResourceAttr(resourceName, "tls_config.#", "0"), ), }, @@ -357,7 +357,7 @@ func TestAccAWSAPIGatewayV2Integration_VpcLinkHttp(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "payload_format_version", "1.0"), resource.TestCheckResourceAttr(resourceName, "request_templates.%", "0"), resource.TestCheckResourceAttr(resourceName, "template_selection_expression", ""), - resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "5001"), + resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "29001"), resource.TestCheckResourceAttr(resourceName, "tls_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "tls_config.0.server_name_to_verify", "www.example.com"), ), @@ -386,7 +386,7 @@ func TestAccAWSAPIGatewayV2Integration_VpcLinkHttp(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "payload_format_version", "1.0"), resource.TestCheckResourceAttr(resourceName, "request_templates.%", "0"), resource.TestCheckResourceAttr(resourceName, "template_selection_expression", ""), - resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "4999"), + resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "29001"), resource.TestCheckResourceAttr(resourceName, "tls_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "tls_config.0.server_name_to_verify", "www.example.org"), ), @@ -436,7 +436,7 @@ func TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "request_parameters.QueueUrl", sqsQueue1ResourceName, "id"), resource.TestCheckResourceAttr(resourceName, "request_templates.%", "0"), resource.TestCheckResourceAttr(resourceName, "template_selection_expression", ""), - resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "29000"), + resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "30000"), resource.TestCheckResourceAttr(resourceName, "tls_config.#", "0"), ), }, @@ -461,7 +461,7 @@ func TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "request_parameters.QueueUrl", sqsQueue2ResourceName, "id"), resource.TestCheckResourceAttr(resourceName, "request_templates.%", "0"), resource.TestCheckResourceAttr(resourceName, "template_selection_expression", ""), - resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "29000"), + resource.TestCheckResourceAttr(resourceName, "timeout_milliseconds", "30000"), resource.TestCheckResourceAttr(resourceName, "tls_config.#", "0"), ), }, @@ -800,7 +800,7 @@ resource "aws_apigatewayv2_integration" "test" { description = "Test private integration" integration_method = "GET" integration_uri = aws_lb_listener.test.arn - timeout_milliseconds = 5001 + timeout_milliseconds = 29001 tls_config { server_name_to_verify = "www.example.com" @@ -817,12 +817,11 @@ resource "aws_apigatewayv2_integration" "test" { api_id = aws_apigatewayv2_api.test.id integration_type = "HTTP_PROXY" - connection_type = "VPC_LINK" - connection_id = aws_apigatewayv2_vpc_link.test.id - description = "Test private integration updated" - integration_method = "POST" - integration_uri = aws_lb_listener.test.arn - timeout_milliseconds = 4999 + connection_type = "VPC_LINK" + connection_id = aws_apigatewayv2_vpc_link.test.id + description = "Test private integration updated" + integration_method = "POST" + integration_uri = aws_lb_listener.test.arn tls_config { server_name_to_verify = "www.example.org" diff --git a/website/docs/r/apigatewayv2_integration.html.markdown b/website/docs/r/apigatewayv2_integration.html.markdown index 9cc2afea4b9..ae991810dbb 100644 --- a/website/docs/r/apigatewayv2_integration.html.markdown +++ b/website/docs/r/apigatewayv2_integration.html.markdown @@ -86,7 +86,9 @@ Valid values: `WHEN_NO_MATCH`, `WHEN_NO_TEMPLATES`, `NEVER`. Default is `WHEN_NO Supported only for WebSocket APIs. * `request_templates` - (Optional) A map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. Supported only for WebSocket APIs. * `template_selection_expression` - (Optional) The [template selection expression](https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-template-selection-expressions) for the integration. -* `timeout_milliseconds` - (Optional) Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds. +* `timeout_milliseconds` - (Optional) Custom timeout between 50 and 29,000 milliseconds for WebSocket APIs and between 50 and 30,000 milliseconds for HTTP APIs. +The default timeout is 29 seconds for WebSocket APIs and 30 seconds for HTTP APIs. +Terraform will only perform drift detection of its value when present in a configuration. * `tls_config` - (Optional) The TLS configuration for a private integration. Supported only for HTTP APIs. The `tls_config` object supports the following: