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

Existing compute_interconnect_attachment will have to be recreated with v3.69.0 #9265

Closed
xiaobaitusi opened this issue May 31, 2021 · 5 comments · Fixed by GoogleCloudPlatform/magic-modules#4841, hashicorp/terraform-provider-google-beta#3309 or #9303
Assignees
Labels

Comments

@xiaobaitusi
Copy link

xiaobaitusi commented May 31, 2021

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 me too comments, 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.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.13.1

  • provider registry.terraform.io/-/google-beta v3.69.0
  • provider registry.terraform.io/hashicorp/google-beta v3.69.0

Affected Resource(s)

  • google_compute_interconnect_attachment

Terraform Configuration Files

resource "google_compute_interconnect_attachment" "tf-test-attachment" {
  provider = google-beta
  name                     = "tf-test-attachment"
  project                  = "my-project"
  interconnect             = "https://www.googleapis.com/compute/v1/projects/interconnect/global/interconnects/test-interconnect"
  type                     = "DEDICATED"
  router                   = "https://www.googleapis.com/compute/beta/projects/my-project/regions/us-west1/routers/computeinterconnectattachment-dep"
  region                   = "us-west1"
  vlan_tag8021q            = 1022
  admin_enabled            = true
  bandwidth                = "BPS_50M"
}

Expected Behavior

with v3.69.0, terraform plan should report no change as v3.67.0

terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

google_compute_interconnect_attachment.tf-test-attachment: Refreshing state... [id=projects/my-project/regions/us-west1/interconnectAttachments/tf-test-attachment]
------------------------------------------------------------------------

No changes. Infrastructure is up-to-date.

Actual Behavior

Once upgrade terraform google provider beta to v3.69.0, terraform plan thinks that the underlying resource needs to be deleted and recreated due to encryption=NONE requiring replacement. AFAIU, NONE should be the default value for encryption if unspecified.

Even after I added the encryption = "NONE" in the configuration file, it still reports that this resource must be replaced.


Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

google_compute_interconnect_attachment.tf-test-attachment: Refreshing state... [id=projects/my-project/regions/us-west1/interconnectAttachments/tf-test-attachment]

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform will perform the following actions:

  # google_compute_interconnect_attachment.tf-test-attachment must be replaced
-/+ resource "google_compute_interconnect_attachment" "tf-test-attachment" {
        admin_enabled              = true
        bandwidth                  = "BPS_50M"
      ~ cloud_router_ip_address    = "REDACTED" -> (known after apply)
      ~ creation_timestamp         = "2021-05-30T17:01:41.670-07:00" -> (known after apply)
      ~ customer_router_ip_address = "REDACTED" -> (known after apply)
      + edge_availability_domain   = (known after apply)
      + encryption                 = "NONE" # forces replacement
      + google_reference_id        = (known after apply)
      ~ id                         = "projects/my-project/regions/us-west1/interconnectAttachments/tf-test-attachment" -> (known after apply)
      ~ interconnect               = "https://www.googleapis.com/compute/beta/projects/my-project/global/interconnects/test-interconnect" -> "https://www.googleapis.com/compute/v1/projects/my-project/global/interconnects/test-interconnect"
      - ipsec_internal_addresses   = [] -> null
      + mtu                        = (known after apply)
        name                       = "tf-test-attachment"
      + pairing_key                = (known after apply)
      + partner_asn                = (known after apply)
      ~ private_interconnect_info  = [
          - {
              - tag8021q = 1022
            },
        ] -> (known after apply)
        project                    = "my-project"
      ~ region                     = "https://www.googleapis.com/compute/v1/projects/my-project/regions/us-west1" -> "us-west1"
      ~ router                     = "https://www.googleapis.com/compute/v1/projects/my-project/regions/us-west1/routers/computeinterconnectattachment-dep" -> "https://www.googleapis.com/compute/beta/projects/my-project/regions/us-west1/routers/computeinterconnectattachment-dep"
      ~ self_link                  = "https://www.googleapis.com/compute/v1/projects/my-project/regions/us-west1/interconnectAttachments/tf-test-attachment" -> (known after apply)
      ~ state                      = "ACTIVE" -> (known after apply)
        type                       = "DEDICATED"
        vlan_tag8021q              = 1022
    }

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

Steps to Reproduce

  1. create a google_compute_interconnect_attachment resource with an older version of terraform-google-provider-beta
  2. upgrade terraform-google-provider-beta to v3.69.0
  3. terraform plan

Important Factoids

References

  • #0000
@megan07
Copy link
Contributor

megan07 commented Jun 1, 2021

Hi @xiaobaitusi ! I'm sorry you're running into this issue. Would you be able to provide me with a copy of the state of this resource, from the 3.67.0 version? And a debug log from running terraform plan would also be helpful. Thanks!

@xiaobaitusi
Copy link
Author

For sure.
the state of this resource:

{
  "version": 4,
  "terraform_version": "0.12.23",
  "serial": 13,
  "lineage": "4dbc945d-aa1d-4ef4-b703-6365748083bb",
  "outputs": {},
  "resources": [
    {
      "mode": "managed",
      "type": "google_compute_interconnect_attachment",
      "name": "tf-test-attachment",
      "provider": "provider.google-beta",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "admin_enabled": true,
            "bandwidth": "BPS_50M",
            "candidate_subnets": null,
            "cloud_router_ip_address": "REDACTED",
            "creation_timestamp": "2021-05-30T17:01:41.670-07:00",
            "customer_router_ip_address": "REDACTED",
            "description": "",
            "edge_availability_domain": "",
            "google_reference_id": "",
            "id": "projects/my-project/regions/us-west1/interconnectAttachments/tf-test-attachment",
            "interconnect": "https://www.googleapis.com/compute/beta/projects/tf-test-interconnect/global/interconnects/kcc-test-interconnect",
            "name": "tf-test-attachment",
            "pairing_key": "",
            "partner_asn": "",
            "private_interconnect_info": [
              {
                "tag8021q": 1022
              }
            ],
            "project": "my-project",
            "region": "https://www.googleapis.com/compute/v1/projects/my-project/regions/us-west1",
            "router": "https://www.googleapis.com/compute/v1/projects/my-project/regions/us-west1/routers/computeinterconnectattachment-dep",
            "self_link": "https://www.googleapis.com/compute/v1/projects/my-project/regions/us-west1/interconnectAttachments/tf-test-attachment",
            "state": "ACTIVE",
            "timeouts": null,
            "type": "DEDICATED",
            "vlan_tag8021q": 1022
          },
        }
      ]
    },

Debug log: https://gist.github.com/xiaobaitusi/6fb91f7bfbd9e0c8c132ec342fc70d0a

@ghost ghost removed the waiting-response label Jun 1, 2021
@xiaobaitusi
Copy link
Author

Any update on the issue here?

@megan07
Copy link
Contributor

megan07 commented Jun 4, 2021

Hi @xiaobaitusi, sorry for the delay on this. I haven't been able to reproduce it, but spoke with someone yesterday who had an idea about what might be happening. I have a fix that should address that. I'll push it shortly. Thanks for your patience.

@github-actions
Copy link

github-actions bot commented Jul 5, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 5, 2021
@github-actions github-actions bot added forward/review In review; remove label to forward service/compute-interconnect labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.