Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_api_gateway_rest_api: Fix disable_execute_api_endpoint a…
…nd endpoint_configuration vpc_endpoint_ids handling with OpenAPI specification import (body argument) (#17209) Reference: #13841 Before code updates, these new acceptance tests show how the Terraform configuration value would not be applied if an OpenAPI specification was imported: ``` === CONT TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint_OverrideBody resource_aws_api_gateway_rest_api_test.go:847: Step 1/4 error: Check failed: 1 error occurred: * Check 2/2 error: aws_api_gateway_rest_api.test: Attribute 'disable_execute_api_endpoint' expected "false", got "true" --- FAIL: TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint_OverrideBody (10.30s) === CONT TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds_OverrideBody resource_aws_api_gateway_rest_api_test.go:369: Step 1/2 error: After applying this test step and performing a `terraform refresh`, the plan was not empty. stdout An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols: ~ update in-place Terraform will perform the following actions: # aws_api_gateway_rest_api.test will be updated in-place ~ resource "aws_api_gateway_rest_api" "test" { id = "m9ajz6izjl" name = "tf-acc-test-6139822644948363723" tags = {} # (9 unchanged attributes hidden) ~ endpoint_configuration { ~ vpc_endpoint_ids = [ + "vpce-0ba0b61be45886a6f", - "vpce-0ee1a2ccd6af8f011", ] # (1 unchanged attribute hidden) } } Plan: 0 to add, 1 to change, 0 to destroy. --- FAIL: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds_OverrideBody (190.95s) ``` Before code updates, these new acceptance tests show how the Terraform resource would report an unexpected difference for missing configurations that were imported by the OpenAPI specification: ``` === CONT TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint_SetByBody resource_aws_api_gateway_rest_api_test.go:890: Step 1/2 error: After applying this test step, the plan was not empty. stdout: An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols: ~ update in-place Terraform will perform the following actions: # aws_api_gateway_rest_api.test will be updated in-place ~ resource "aws_api_gateway_rest_api" "test" { ~ disable_execute_api_endpoint = true -> false id = "c2t6iky152" name = "tf-acc-test-8877194198775672292" # (8 unchanged attributes hidden) # (1 unchanged block hidden) } Plan: 0 to add, 1 to change, 0 to destroy. --- FAIL: TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint_SetByBody (11.03s) === CONT TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds_SetByBody resource_aws_api_gateway_rest_api_test.go:415: Step 1/2 error: After applying this test step, the plan was not empty. stdout: An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols: ~ update in-place Terraform will perform the following actions: # aws_api_gateway_rest_api.test will be updated in-place ~ resource "aws_api_gateway_rest_api" "test" { id = "adeg2zcky2" name = "tf-acc-test-7848512816247428885" # (9 unchanged attributes hidden) ~ endpoint_configuration { ~ vpc_endpoint_ids = [ - "vpce-0653ca468e4c6ba4a", ] # (1 unchanged attribute hidden) } } Plan: 0 to add, 1 to change, 0 to destroy. --- FAIL: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds_SetByBody (150.67s) ``` Output from acceptance testing: ``` --- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource (30.53s) --- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource_OverrideBody (37.78s) --- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource_SetByBody (15.25s) --- PASS: TestAccAWSAPIGatewayRestApi_basic (669.92s) --- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes (34.56s) --- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_OverrideBody (34.23s) --- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_SetByBody (514.96s) --- PASS: TestAccAWSAPIGatewayRestApi_Body (38.01s) --- PASS: TestAccAWSAPIGatewayRestApi_Description (23.87s) --- PASS: TestAccAWSAPIGatewayRestApi_Description_OverrideBody (60.58s) --- PASS: TestAccAWSAPIGatewayRestApi_Description_SetByBody (92.79s) --- PASS: TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint (3442.94s) --- PASS: TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint_OverrideBody (2292.47s) --- PASS: TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint_SetByBody (1083.96s) --- PASS: TestAccAWSAPIGatewayRestApi_disappears (529.45s) --- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration (1034.47s) --- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_Private (15.42s) --- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds (330.11s) --- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds_OverrideBody (205.73s) --- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds_SetByBody (159.85s) --- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize (39.32s) --- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_OverrideBody (1278.64s) --- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_SetByBody (753.00s) --- PASS: TestAccAWSAPIGatewayRestApi_Name_OverrideBody (2212.45s) --- PASS: TestAccAWSAPIGatewayRestApi_Parameters (948.67s) --- PASS: TestAccAWSAPIGatewayRestApi_Policy (28.00s) --- PASS: TestAccAWSAPIGatewayRestApi_Policy_OverrideBody (80.78s) --- PASS: TestAccAWSAPIGatewayRestApi_Policy_SetByBody (1967.74s) --- PASS: TestAccAWSAPIGatewayRestApi_tags (1413.12s) ```
- Loading branch information