Skip to content

Commit e3713cb

Browse files
fix: replace authoritative project metadata with non-authoritative items
google_compute_project_metadata is authoritative — on first apply it deletes all other project-level metadata (OS Login config, SSH keys, etc.) managed outside this module. Switch to google_compute_project_metadata_item which only manages the individual keys this module needs, leaving other metadata untouched. Co-authored-by: Ona <no-reply@ona.com>
1 parent 59066c3 commit e3713cb

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

runner-vm.tf

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,17 @@ resource "google_compute_health_check" "runner" {
354354

355355

356356
# Resource tagging for lifecycle management
357-
resource "google_compute_project_metadata" "runner_metadata" {
357+
# Use google_compute_project_metadata_item (non-authoritative) instead of
358+
# google_compute_project_metadata to avoid clobbering other project metadata
359+
# (OS Login config, SSH keys, etc.) managed outside this module.
360+
resource "google_compute_project_metadata_item" "enable_oslogin" {
358361
project = var.project_id
362+
key = "enable-oslogin"
363+
value = "TRUE"
364+
}
359365

360-
metadata = {
361-
"enable-oslogin" = "TRUE"
362-
"gitpod-runner-id" = var.runner_id
363-
}
366+
resource "google_compute_project_metadata_item" "runner_id" {
367+
project = var.project_id
368+
key = "gitpod-runner-id"
369+
value = var.runner_id
364370
}

0 commit comments

Comments
 (0)