Skip to content

Network's profile field reports diff even when it's not changing #23160

@AshwinGururagh

Description

@AshwinGururagh

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 a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v1.12.1
on darwin_arm64

  • provider registry.terraform.io/hashicorp/google vX.X.X
  • provider registry.terraform.io/hashicorp/google-beta vX.X.X

Affected Resource(s)

google_compute_network

Terraform Configuration

resource "google_compute_network" "vpc_network" {
  name                    = "tf-test-net-1"
  auto_create_subnetworks = false
  network_profile = "projects/myproj/global/europe-west1-b-vpc-roce"
}

Debug Output

No response

Expected Behavior

With the above configuration, running terraform apply without any changes once the resource has been created the first time should be a no-op.

Actual Behavior

With the above configuration, running terraform apply without any changes after the resource has been created the first time, leads to forced replacement of the Network resource.

Terraform will perform the following actions:

  # google_compute_network.vpc_network must be replaced
-/+ resource "google_compute_network" "vpc_network" {
      ~ bgp_always_compare_med                    = false -> (known after apply)
      ~ bgp_best_path_selection_mode              = "LEGACY" -> (known after apply)
      + bgp_inter_region_cost                     = (known after apply)
      - enable_ula_internal_ipv6                  = false -> null
      + gateway_ipv4                              = (known after apply)
      ~ id                                        = "projects/myproj/global/networks/tf-test-net-1" -> (known after apply)
      + internal_ipv6_range                       = (known after apply)
      ~ mtu                                       = 0 -> (known after apply)
        name                                      = "tf-test-net-1"
      ~ network_id                                = "12345" -> (known after apply)
      ~ network_profile                           = "https://www.googleapis.com/compute/v1/projects/myproj/global/networkProfiles/us-west3-c-vpc-roce" -> "projects/myproj/global/networkProfiles/us-west3-c-vpc-roce" # forces replacement
      ~ numeric_id                                = "12345" -> (known after apply)
      ~ routing_mode                              = "REGIONAL" -> (known after apply)
      ~ self_link                                 = "https://www.googleapis.com/compute/v1/projects/myproj/global/networks/tf-test-net-1" -> (known after apply)
        # (5 unchanged attributes hidden)
    }

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

Steps to reproduce

  1. terraform apply

Important Factoids

No response

References

terraform-google-modules/terraform-google-network#622

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions