Skip to content

Make change on google_compute_network_peering non destructive #5971

@sdif

Description

@sdif

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 the 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 the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

Hi,
We want to enable export_custom_routes on a previously created google_compute_network_peering resource but it's a destructive operation when done through Terraform where it is not the case when done through the GCP Web UI.

Here is the output of the Terraform plan:

  # google_compute_network_peering.peering-production-data-prod must be replaced
-/+ resource "google_compute_network_peering" "peering-production-data-prod" {
      ~ auto_create_routes   = true -> (known after apply)
      ~ export_custom_routes = false -> true # forces replacement
      ~ id                   = "production-network/peering-production-data-prod" -> (known after apply)
        import_custom_routes = false
        name                 = "peering-production-data-prod"
        network              = "https://www.googleapis.com/compute/v1/projects/***/global/networks/production-network"
        peer_network         = "https://www.googleapis.com/compute/v1/projects/***/global/networks/data-prod-network"
      ~ state                = "ACTIVE" -> (known after apply)
      ~ state_details        = "[2020-03-25T07:38:13.328-07:00]: Connected." -> (known after apply)
    }

Is it possible to make this change non destructive ?
Thanks!

New or Affected Resource(s)

  • google_compute_network_peering

Potential Terraform Configuration

resource "google_compute_network_peering" "peering-production-data-prod" {
  name         = "peering-production-data-prod"
  network      = google_compute_network.production.self_link
  peer_network = data.google_compute_network.data-prod-network.self_link

  export_custom_routes = true
}

References

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions