Skip to content

Conversation

FabrizioCafolla
Copy link

Description

This PR fixes an issue in version 9.0.0 where adding params block to an existing bastion host instance would force unnecessary VM replacement.

Problem

In the current implementation, the params block is always present in the google_compute_instance_from_template.bastion_vm resource, which causes Terraform to force replacement of the VM when resource_manager_tags are added to an existing instance:

# module.iap_bastion_host.google_compute_instance_from_template.bastion_vm[0] must be replaced
-/+ resource "google_compute_instance_from_template" "bastion_vm" {
  ...
+ params { # forces replacement
    + resource_manager_tags = (known after apply)
  }
  ...
}

Solution

The fix implements a dynamic "params" block that only creates the params configuration when var.resource_manager_tags is not null. This prevents unnecessary VM destruction and recreation when resource manager tags are added or modified.

@FabrizioCafolla FabrizioCafolla requested a review from a team as a code owner October 8, 2025 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant