Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_api_gateway_rest_api private API does not set VPC Endpoint association or policy until SECOND apply. #13841

Closed
bassmanitram opened this issue Jun 19, 2020 · 18 comments · Fixed by #17209
Assignees
Labels
bug Addresses a defect in current functionality. service/apigateway Issues and PRs that pertain to the apigateway service.
Milestone

Comments

@bassmanitram
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.14
AWS provider 2.67.0

Affected Resource(s)

  • aws_api_gateway_rest_api

Terraform Configuration Files

resource "aws_api_gateway_rest_api" "service_api_private_vpce" {
  count = "${local.private_vpce ? 1 : 0}"
  name = "${var.api_name}"

  body = "${var.api_openapi_yaml == "" ? data.template_file.openapi_yaml.rendered : var.api_openapi_yaml}"

  policy = "${data.template_file.policy.rendered}"

  endpoint_configuration {
  #
  # This will always be PRIVATE here
  #
    types = ["${local.endpoint_type}"]
    vpc_endpoint_ids = ["${module.environment_vpc_endpoint_id.ssm_parameter_value}"]
  }
  lifecycle {
      #
      # Plans have a permanent difference here!
      #
      ignore_changes = [ "binary_media_types" ]
  }
}

Expected Behavior

API should be created with endpoint type PRIVATE, associated with the passed VPCE ID and with
the provided policy attached

Actual Behavior

API is created as PRIVATE but without the VPCE association or the policy. Then running terraform apply a second time, the policy and the VPCE association are set

Steps to Reproduce

  • create the necessary infrastructure to have a VPCE associated with the API Gateway
  • create a terraform config file with the contents as provided by the plan output below, substituting
    the VPCE ID in your config for the one currently in the content below
  • terraform apply
  • examine the API in the API Gateway console - no policy, no VPCE
  • terraform apply
  • examine the API in the API Gateway console - policy and VPCE exist

Important Factoids

While the above resource property settings use a lot of variables, the plan output shows that the values have been correctly resolved

  + module.main.module.console_service_api.module.api.aws_api_gateway_rest_api.service_api_private_vpce
      id:                                                    <computed>
      api_key_source:                                        "HEADER"
      arn:                                                   <computed>
      body:                                                  "---\nswagger: \"2.0\"\ninfo:\n  version: \"2019-02-19T16:23:40Z\"\n  title: \"Assure-Platform-Console-Service-private-1\"\nschemes:\n- \"https\"\npaths:\n  /:\n    get:\n      produces:\n      - \"application/json\"\n      responses:\n        200:\n          description: \"200 response\"\n          schema:\n            $ref: \"#/definitions/Empty\"\n      x-amazon-apigateway-integration:\n        uri: \"arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:665158502186:function:${stageVariables.integrationLambda}/invocations\"\n        credentials: \"arn:aws:iam::665158502186:role/${stageVariables.integrationLambdaExecRole}\"\n        responses:\n          default:\n            statusCode: \"200\"\n        passthroughBehavior: \"when_no_match\"\n        httpMethod: \"POST\"\n        contentHandling: \"CONVERT_TO_TEXT\"\n        type: \"aws_proxy\"\n    options:\n      consumes:\n      - \"application/json\"\n      produces:\n      - \"application/json\"\n      responses:\n        200:\n          description: \"200 response\"\n          schema:\n            $ref: \"#/definitions/Empty\"\n          headers:\n            Access-Control-Allow-Origin:\n              type: \"string\"\n            Access-Control-Allow-Methods:\n              type: \"string\"\n            Access-Control-Allow-Headers:\n              type: \"string\"\n      x-amazon-apigateway-integration:\n        responses:\n          default:\n            statusCode: \"200\"\n            responseParameters:\n              method.response.header.Access-Control-Allow-Methods: \"'POST,OPTIONS'\"\n              method.response.header.Access-Control-Allow-Headers: \"'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'\"\n              method.response.header.Access-Control-Allow-Origin: \"'*'\"\n        requestTemplates:\n          application/json: \"{\\\"statusCode\\\": 200}\"\n        passthroughBehavior: \"when_no_match\"\n        type: \"mock\"\ndefinitions:\n  Empty:\n    type: \"object\"\n    title: \"Empty Schema\"\n\n"
      created_date:                                          <computed>
      endpoint_configuration.#:                              "1"
      endpoint_configuration.0.types.#:                      "1"
      endpoint_configuration.0.types.0:                      "PRIVATE"
      endpoint_configuration.0.vpc_endpoint_ids.#:           "1"
      endpoint_configuration.0.vpc_endpoint_ids.1596079509:  "vpce-0efe2662207bd63a0"
      execution_arn:                                         <computed>
      minimum_compression_size:                              "-1"
      name:                                                  "Assure-Platform-Console-Service-private-1"
      policy:                                                "{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Deny\",\n            \"Principal\": \"*\",\n            \"Action\": \"execute-api:Invoke\",\n            \"Resource\": \"execute-api:/*\",\n            \"Condition\": {\n                \"StringNotEquals\": {\n                    \"aws:sourceVpce\": \"vpce-0efe2662207bd63a0\"\n                }\n            }\n        },\n        {\n            \"Effect\": \"Allow\",\n            \"Principal\": \"*\",\n            \"Action\": \"execute-api:Invoke\",\n            \"Resource\": \"execute-api:/*\"\n        }\n    ]\n}"
      root_resource_id:                                      <computed>

That VPCE ID has been confirmed to exist and be active at the time of the apply, and, when in the API Gateway console, is available for attachment to the API

On running terraform apply the second time (immediately after the first attempt that fails to set the policy and VPCE association), I get a diff for the VPCE and the policy.

  ~ module.main.module.console_service_api.module.api.aws_api_gateway_rest_api.service_api_private_vpce
      endpoint_configuration.0.vpc_endpoint_ids.#:           "0" => "1"
      endpoint_configuration.0.vpc_endpoint_ids.1596079509:  "" => "vpce-0efe2662207bd63a0"
      policy:                                                "" => "{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Effect\": \"Deny\",\n            \"Principal\": \"*\",\n            \"Action\": \"execute-api:Invoke\",\n            \"Resource\": \"execute-api:/*\",\n            \"Condition\": {\n                \"StringNotEquals\": {\n                    \"aws:sourceVpce\": \"vpce-0efe2662207bd63a0\"\n                }\n            }\n        },\n        {\n            \"Effect\": \"Allow\",\n            \"Principal\": \"*\",\n            \"Action\": \"execute-api:Invoke\",\n            \"Resource\": \"execute-api:/*\"\n        }\n    ]\n}"

Letting THAT run through, adds the VPCE association and the policy.

@ghost ghost added the service/apigateway Issues and PRs that pertain to the apigateway service. label Jun 19, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jun 19, 2020
@bassmanitram
Copy link
Author

bassmanitram commented Jun 19, 2020

This is VERY likely due to parameters being ignored, or overridden, if the body is provided - but my reasoning would be "I know the body YAML only provides the structure of the API and not the endpoint config requirements because the business team is building that. The operations team require APIs to have policies and be private, so I am asking TF to 'force' in other parameters (such as the policy and the VPCE config) by including them in the resource". If my reasoning rings true, importing the body and then patching the API with the policy and the VPCE config (and the binary types which also suffer from this issue) with any provided values would appear the most consistent solution.

@bassmanitram
Copy link
Author

The other side of this is that if we do manage to the hack the body string that is passed to this module and add the x-amazon-apigateway-policy and x-amazon-apigateway-endpoint-configuration sections that are the equivalents of the policy and VPCE config properties of the TF resource, and then remove those properties from the TF resource, the second terraform apply will attempt to delete them. Rock and a hard place here.

@bassmanitram
Copy link
Author

Looking at https://github.com/terraform-providers/terraform-provider-aws/blob/master/aws/resource_aws_api_gateway_rest_api.go I see what's happening - the API is created with all the specified properties, and then the body is imported, which overwrites the VPCE association, policy, and binary types. There isn't a different order to do that - you have to create it first, but a possible fix would be to create the API with no optional parameters, then import the body, then patch the provided (affected) parameters, the reasoning being that "whatever I specify in my TF resource configuration should override what's in the body". This would fix both issues (the non-setting when the parameters are specified, and the diff when the parameters are in the body).

@breathingdust breathingdust added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 7, 2020
@thenom
Copy link

thenom commented Nov 17, 2020

Does anyone have a workaround until this is fixed as this mean that TF cannot be applied to a live service as it would cause an outage?

I am going to try the x-amazon-apigateway-endpoint-configuration option but it seems that this has been confirmed as a no go.

@thenom
Copy link

thenom commented Nov 17, 2020

Yep, i now get no VPCE ID configured no matter how many times i run it with x-amazon-apigateway-endpoint-configuration set and this in TF:

  endpoint_configuration {
    types = ["PRIVATE"]
  }

i assume as there is no VPCE ID set here it is wiping it out.

@bassmanitram
Copy link
Author

bassmanitram commented Nov 17, 2020 via email

@thenom
Copy link

thenom commented Nov 17, 2020

Thanks @bassmanitram but thats what i tried above but i get no VPCE if i do it that way. Unless i am implementing this wrong:
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-endpoint-configuration.html

i.e. OAS file:

{
  "openapi": "3.0.0",
  "x-amazon-apigateway-endpoint-configuration": {
    "vpcEndpointIds": ["vpce-0212a4ababd5b8c3e"]
  },
  ....

TF:

  endpoint_configuration {
    types = ["PRIVATE"]
  }

@thenom
Copy link

thenom commented Nov 18, 2020

Do i have to have both the policy AND the VPCEndpoint config in the OAS file for this to work?

@thenom
Copy link

thenom commented Nov 18, 2020

It seems i missed this vital bit of documentation... :/

it should be present under the vendor extensions of the Server object.

Re-attempting

@thenom
Copy link

thenom commented Nov 18, 2020

Ok, to confirm. Just the x-amazon-apigateway-endpoint-configuration on its own without the policy in the OAS body does not work. You need both in the body for this to work. As a bonus, TF does not keep re-writing the policy with the shortened execute-api resource name every time, i.e.:

~ Resource = "arn:aws:execute-api:eu-west-1:1234567890:a12b34c56/*/*/*" -> "execute-api:/*/*/*"

For future googlers, this works for me:

{
  "openapi": "3.0.0",
  "servers": [
    {
      "x-amazon-apigateway-endpoint-configuration": {
        "vpcEndpointIds": []
      }
    }
  ],
  "x-amazon-apigateway-policy": {
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Deny",
            "Principal": "*",
            "Action": "execute-api:Invoke",
            "Resource": "execute-api:/*/*/*",
            "Condition": {
                "StringNotEquals": {
                    "aws:sourceVpc": []
                }
            }
        },
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": "execute-api:Invoke",
            "Resource": "execute-api:/*/*/*"
        }
    ]
  },

Then i just replace "vpcEndpointIds": [] and "aws:sourceVpc": [] at plan\apply time with the tfvars.

@bassmanitram
Copy link
Author

bassmanitram commented Nov 18, 2020 via email

@thenom
Copy link

thenom commented Nov 18, 2020

Almost, this seems to have fixed the VPCE issue but in resources now i am getting:

image

I am trying to find out why it is ignoring the policy extension i have applied.

@thenom
Copy link

thenom commented Nov 23, 2020

This now works fine with the policy setup but i noticed that with removing this block:

  endpoint_configuration {
    types = ["PRIVATE"]
  }

It works fine with an existing API but when i was reattempted a redeploy it fails due to the fact that type private is not set anywhere. I have looked through the extensions docs and in x-amazon-apigateway-endpoint-configuration it just says that is needs it to be private:

It is only supported for REST APIs the PRIVATE endpoint type.

This seems to be what the TF block is for but there doesnt seem to be anyway to set this on an extension which i am assuming is because you need the API setup before you can import the OAS file, another rock and a hard place...

The only way i have around this is on initial deploy is to just re-add that block which breaks the VPCE setup and then remove it again and redeploy to fix the VPCE.

@sylwit
Copy link

sylwit commented Dec 24, 2020

Also facing the same problem. Another option would be to allow the usage of the default Merge strategy instead of Overwrite. If the choice is explicit in the resource then it could be useful in cases like this. It would also make terraform consistent with aws put-rest-api default.

Definition in the SDK
https://github.com/aws/aws-sdk-go/blob/master/service/apigateway/api.go#L26016

Doc:
https://docs.aws.amazon.com/cli/latest/reference/apigateway/put-rest-api.html

Usage in terraform
https://github.com/hashicorp/terraform-provider-aws/blob/master/aws/resource_aws_api_gateway_rest_api.go#L182

A proposal could be:

resource "aws_api_gateway_rest_api" "api" {
  ...
  body: templatefile(...)
  body_strategy: "Merge|Overwrite"
}

What do you think ?

@bflad bflad self-assigned this Jan 14, 2021
bflad added a commit that referenced this issue Jan 14, 2021
…cceptance testing and fix various attributes after import

Reference: #5364
Reference: #7161
Reference: #9722
Reference: #10766
Reference: #12432
Reference: #13841
Reference: #14290
Reference: #14660

Changes:

```
* resource/aws_api_gateway_rest_api: Ensure `api_key_source`, `binary_media_types`, `description`, `minimum_compression_size`, `name`, and `policy` configuration values are correctly applied as an override after OpenAPI specification import (`body` argument)
* resource/aws_api_gateway_rest_api: Allow `api_key_source`, `binary_media_types`, and `description` arguments to be omitted from configuration with OpenAPI specification import (`body` argument)
```

The overall testing changes are:

* Ensuring the basic test covers all attributes
* Refactoring the basic test into per-attribute testing
* Adding per-attribute tests to cover OpenAPI specificiations (`body` argument) being set without Terraform configurations -- these should be allowed with Terraform showing a planned difference
* Adding per-attribute tests to cover OpenAPI specificiations (`body` argument) being set with Terraform configurations -- these should be allowed with the Terraform configuration value overriding the OpenAPI specification
* Removing extraneous API object `TestCheckFunc` (covered by `ImportStateVerify` testing)

It is worth mentioning that this does not cover the `disable_execute_api_endpoint` or `tags` attributes that can also be specified by OpenAPI since this change set is already very large. The `minimum_compression_size` attribute also needs an additional update to support OpenAPI-only configuration. Further updates can improve on this effort.

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_ApiKeySource_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:428: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 2/2 error: aws_api_gateway_rest_api.test: Attribute 'api_key_source' expected "AUTHORIZER", got "HEADER"

--- FAIL: TestAccAWSAPIGatewayRestApi_ApiKeySource_OverrideBody (8.82s)

=== CONT  TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:464: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 3/3 error: aws_api_gateway_rest_api.test: Attribute 'binary_media_types.0' expected "application/octet-stream", got "image/jpeg"

=== CONT  TestAccAWSAPIGatewayRestApi_Description_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:527: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 2/2 error: aws_api_gateway_rest_api.test: Attribute 'description' expected "tfdescription1", got "oasdescription1"

--- FAIL: TestAccAWSAPIGatewayRestApi_Description_OverrideBody (9.60s)

=== CONT  TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:688: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 2/2 error: aws_api_gateway_rest_api.test: Attribute 'minimum_compression_size' expected "1", got "5242880"

--- FAIL: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_OverrideBody (8.41s)

=== CONT  TestAccAWSAPIGatewayRestApi_Name_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:528: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 2/2 error: aws_api_gateway_rest_api.test: Attribute 'name' expected "tf-acc-test-4252368909257291928", got "title1"

--- FAIL: TestAccAWSAPIGatewayRestApi_Name_OverrideBody (8.57s)

=== CONT  TestAccAWSAPIGatewayRestApi_Policy_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:593: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 4/4 error: aws_api_gateway_rest_api.test: Attribute 'policy' didn't match "\"Allow\"", got ""

--- FAIL: TestAccAWSAPIGatewayRestApi_Policy_OverrideBody (9.37s)
```

Before code updates, these acceptance tests show how the Terraform resource would report an unexpected difference for missing configurations that were imported by the OpenAPI specification:

```
=== CONT  TestAccAWSAPIGatewayRestApi_ApiKeySource_SetByBody
    resource_aws_api_gateway_rest_api_test.go:471: 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" {
              ~ api_key_source               = "AUTHORIZER" -> "HEADER"
                id                           = "5ja4mnzxta"
                name                         = "tf-acc-test-4415455482847955650"
                # (8 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }

        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccAWSAPIGatewayRestApi_ApiKeySource_SetByBody (20.65s)

=== CONT  TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_SetByBody
    resource_aws_api_gateway_rest_api_test.go:510: 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" {
              ~ binary_media_types           = [
                  - "application/octet-stream",
                ]
                id                           = "7we4bv4s8b"
                name                         = "tf-acc-test-2053199682951305540"
                # (8 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }

        Plan: 0 to add, 1 to change, 0 to destroy.

=== CONT  TestAccAWSAPIGatewayRestApi_Description_SetByBody
    resource_aws_api_gateway_rest_api_test.go:570: 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" {
              - description                  = "oasdescription1" -> null
                id                           = "3k0fykhp76"
                name                         = "tf-acc-test-2107985362088533117"
                # (8 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }

        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccAWSAPIGatewayRestApi_Description_SetByBody (10.02s)

=== CONT  TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_SetByBody
    resource_aws_api_gateway_rest_api_test.go:731: 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                           = "bcmvzz0jfi"
              ~ minimum_compression_size     = 1048576 -> -1
                name                         = "tf-acc-test-2006611344091675720"
                # (7 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }

        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_SetByBody (10.99s)
```

Additionally these new acceptance tests show how the Terraform resource already respected missing configurations that were imported by the OpenAPI specification:

```
--- PASS: TestAccAWSAPIGatewayRestApi_Policy_SetByBody (15.03s)
```

Output from acceptance testing:

```
--- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource (28.57s)
--- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource_OverrideBody (52.53s)
--- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource_SetByBody (25.48s)
--- PASS: TestAccAWSAPIGatewayRestApi_basic (23.16s)
--- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes (80.33s)
--- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_OverrideBody (34.45s)
--- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_SetByBody (24.16s)
--- PASS: TestAccAWSAPIGatewayRestApi_Body (26.69s)
--- PASS: TestAccAWSAPIGatewayRestApi_Description (765.29s)
--- PASS: TestAccAWSAPIGatewayRestApi_Description_OverrideBody (32.87s)
--- PASS: TestAccAWSAPIGatewayRestApi_Description_SetByBody (51.31s)
--- PASS: TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint (30.21s)
--- PASS: TestAccAWSAPIGatewayRestApi_disappears (38.64s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration (58.23s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_Private (15.02s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VPCEndpoint (305.78s)
--- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize (42.89s)
--- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_OverrideBody (35.97s)
--- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_SetByBody (106.39s)
--- PASS: TestAccAWSAPIGatewayRestApi_Name_OverrideBody (86.16s)
--- PASS: TestAccAWSAPIGatewayRestApi_Parameters (39.90s)
--- PASS: TestAccAWSAPIGatewayRestApi_Policy (683.47s)
--- PASS: TestAccAWSAPIGatewayRestApi_Policy_OverrideBody (905.68s)
--- PASS: TestAccAWSAPIGatewayRestApi_Policy_SetByBody (28.12s)
--- PASS: TestAccAWSAPIGatewayRestApi_tags (32.94s)
```
bflad added a commit that referenced this issue Jan 20, 2021
…cceptance testing and fix various attributes after import (#17099)

* fix bug with rest api openapi removing policy

* resource/aws_api_gateway_rest_api: Additional OpenAPI specification acceptance testing and fix various attributes after import

Reference: #5364
Reference: #7161
Reference: #9722
Reference: #10766
Reference: #12432
Reference: #13841
Reference: #14290
Reference: #14660

Changes:

```
* resource/aws_api_gateway_rest_api: Ensure `api_key_source`, `binary_media_types`, `description`, `minimum_compression_size`, `name`, and `policy` configuration values are correctly applied as an override after OpenAPI specification import (`body` argument)
* resource/aws_api_gateway_rest_api: Allow `api_key_source`, `binary_media_types`, and `description` arguments to be omitted from configuration with OpenAPI specification import (`body` argument)
```

The overall testing changes are:

* Ensuring the basic test covers all attributes
* Refactoring the basic test into per-attribute testing
* Adding per-attribute tests to cover OpenAPI specificiations (`body` argument) being set without Terraform configurations -- these should be allowed with Terraform showing a planned difference
* Adding per-attribute tests to cover OpenAPI specificiations (`body` argument) being set with Terraform configurations -- these should be allowed with the Terraform configuration value overriding the OpenAPI specification
* Removing extraneous API object `TestCheckFunc` (covered by `ImportStateVerify` testing)

It is worth mentioning that this does not cover the `disable_execute_api_endpoint` or `tags` attributes that can also be specified by OpenAPI since this change set is already very large. The `minimum_compression_size` attribute also needs an additional update to support OpenAPI-only configuration. Further updates can improve on this effort.

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_ApiKeySource_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:428: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 2/2 error: aws_api_gateway_rest_api.test: Attribute 'api_key_source' expected "AUTHORIZER", got "HEADER"

--- FAIL: TestAccAWSAPIGatewayRestApi_ApiKeySource_OverrideBody (8.82s)

=== CONT  TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:464: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 3/3 error: aws_api_gateway_rest_api.test: Attribute 'binary_media_types.0' expected "application/octet-stream", got "image/jpeg"

=== CONT  TestAccAWSAPIGatewayRestApi_Description_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:527: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 2/2 error: aws_api_gateway_rest_api.test: Attribute 'description' expected "tfdescription1", got "oasdescription1"

--- FAIL: TestAccAWSAPIGatewayRestApi_Description_OverrideBody (9.60s)

=== CONT  TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:688: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 2/2 error: aws_api_gateway_rest_api.test: Attribute 'minimum_compression_size' expected "1", got "5242880"

--- FAIL: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_OverrideBody (8.41s)

=== CONT  TestAccAWSAPIGatewayRestApi_Name_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:528: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 2/2 error: aws_api_gateway_rest_api.test: Attribute 'name' expected "tf-acc-test-4252368909257291928", got "title1"

--- FAIL: TestAccAWSAPIGatewayRestApi_Name_OverrideBody (8.57s)

=== CONT  TestAccAWSAPIGatewayRestApi_Policy_OverrideBody
    resource_aws_api_gateway_rest_api_test.go:593: Step 1/4 error: Check failed: 1 error occurred:
        	* Check 4/4 error: aws_api_gateway_rest_api.test: Attribute 'policy' didn't match "\"Allow\"", got ""

--- FAIL: TestAccAWSAPIGatewayRestApi_Policy_OverrideBody (9.37s)
```

Before code updates, these acceptance tests show how the Terraform resource would report an unexpected difference for missing configurations that were imported by the OpenAPI specification:

```
=== CONT  TestAccAWSAPIGatewayRestApi_ApiKeySource_SetByBody
    resource_aws_api_gateway_rest_api_test.go:471: 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" {
              ~ api_key_source               = "AUTHORIZER" -> "HEADER"
                id                           = "5ja4mnzxta"
                name                         = "tf-acc-test-4415455482847955650"
                # (8 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }

        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccAWSAPIGatewayRestApi_ApiKeySource_SetByBody (20.65s)

=== CONT  TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_SetByBody
    resource_aws_api_gateway_rest_api_test.go:510: 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" {
              ~ binary_media_types           = [
                  - "application/octet-stream",
                ]
                id                           = "7we4bv4s8b"
                name                         = "tf-acc-test-2053199682951305540"
                # (8 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }

        Plan: 0 to add, 1 to change, 0 to destroy.

=== CONT  TestAccAWSAPIGatewayRestApi_Description_SetByBody
    resource_aws_api_gateway_rest_api_test.go:570: 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" {
              - description                  = "oasdescription1" -> null
                id                           = "3k0fykhp76"
                name                         = "tf-acc-test-2107985362088533117"
                # (8 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }

        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccAWSAPIGatewayRestApi_Description_SetByBody (10.02s)

=== CONT  TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_SetByBody
    resource_aws_api_gateway_rest_api_test.go:731: 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                           = "bcmvzz0jfi"
              ~ minimum_compression_size     = 1048576 -> -1
                name                         = "tf-acc-test-2006611344091675720"
                # (7 unchanged attributes hidden)

                # (1 unchanged block hidden)
            }

        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_SetByBody (10.99s)
```

Additionally these new acceptance tests show how the Terraform resource already respected missing configurations that were imported by the OpenAPI specification:

```
--- PASS: TestAccAWSAPIGatewayRestApi_Policy_SetByBody (15.03s)
```

Output from acceptance testing:

```
--- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource (28.57s)
--- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource_OverrideBody (52.53s)
--- PASS: TestAccAWSAPIGatewayRestApi_ApiKeySource_SetByBody (25.48s)
--- PASS: TestAccAWSAPIGatewayRestApi_basic (23.16s)
--- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes (80.33s)
--- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_OverrideBody (34.45s)
--- PASS: TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_SetByBody (24.16s)
--- PASS: TestAccAWSAPIGatewayRestApi_Body (26.69s)
--- PASS: TestAccAWSAPIGatewayRestApi_Description (765.29s)
--- PASS: TestAccAWSAPIGatewayRestApi_Description_OverrideBody (32.87s)
--- PASS: TestAccAWSAPIGatewayRestApi_Description_SetByBody (51.31s)
--- PASS: TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint (30.21s)
--- PASS: TestAccAWSAPIGatewayRestApi_disappears (38.64s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration (58.23s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_Private (15.02s)
--- PASS: TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VPCEndpoint (305.78s)
--- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize (42.89s)
--- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_OverrideBody (35.97s)
--- PASS: TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_SetByBody (106.39s)
--- PASS: TestAccAWSAPIGatewayRestApi_Name_OverrideBody (86.16s)
--- PASS: TestAccAWSAPIGatewayRestApi_Parameters (39.90s)
--- PASS: TestAccAWSAPIGatewayRestApi_Policy (683.47s)
--- PASS: TestAccAWSAPIGatewayRestApi_Policy_OverrideBody (905.68s)
--- PASS: TestAccAWSAPIGatewayRestApi_Policy_SetByBody (28.12s)
--- PASS: TestAccAWSAPIGatewayRestApi_tags (32.94s)
```

* tests/resource/aws_api_gateway_rest_api: terrafmt fixes

* tests/resource/aws_api_gateway_rest_api: Remove extraneous minimum_compression_size testing from basic test

* docs/resource/aws_api_gateway_rest_api: Fix misspell

* Apply suggestions from code review

Co-authored-by: Dirk Avery <31492422+YakDriver@users.noreply.github.com>

Co-authored-by: james.warren <james.warren@digital.justice.gov.uk>
Co-authored-by: Dirk Avery <31492422+YakDriver@users.noreply.github.com>
@bflad
Copy link
Contributor

bflad commented Jan 21, 2021

Fixes for the aws_api_gateway_rest_api resource handling of api_key_source, binary_media_types, description, minimum_compression_size, name, and policy configuration values will now be correctly applied as an override after OpenAPI specification import (body argument) on resource creation and update. This will release with version 3.25.0 of the Terraform AWS Provider, likely tomorrow.

Leaving this issue open to further handle the cases of endpoint_configuration values. I'll poke at that right now.

bflad added a commit that referenced this issue Jan 21, 2021
…nd endpoint_configuration vpc_endpoint_ids handling with OpenAPI specification import (body argument)

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)
```
bflad added a commit that referenced this issue Jan 21, 2021
…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)
```
@github-actions github-actions bot added this to the v3.25.0 milestone Jan 21, 2021
@bflad
Copy link
Contributor

bflad commented Jan 21, 2021

Fixes for the disable_execute_api_endpoint and endpoint_configuration vpc_endpoint_ids handling in the aws_api_gateway_rest_api resource have also been merged and will release with version 3.25.0 of the Terraform AWS Provider, later today. 👍

For further feature requests, documentation updates, or bug reports with this functionality after it is released and upgrading the provider, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Jan 22, 2021

This has been released in version 3.25.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Feb 21, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/apigateway Issues and PRs that pertain to the apigateway service.
Projects
None yet
5 participants