Skip to content

fix: replace authoritative project metadata with non-authoritative items (B1)#24

Merged
nandajavarma merged 1 commit into
mainfrom
nv/fix-authoritative-metadata
May 7, 2026
Merged

fix: replace authoritative project metadata with non-authoritative items (B1)#24
nandajavarma merged 1 commit into
mainfrom
nv/fix-authoritative-metadata

Conversation

@nandajavarma
Copy link
Copy Markdown
Collaborator

Problem

google_compute_project_metadata is an authoritative resource — on first terraform apply it deletes all other project-level metadata (OS Login config, SSH keys, etc.) managed outside this module. This silently destroys customer metadata.

Fix

Replace with google_compute_project_metadata_item resources, which only manage the individual keys this module needs (enable-oslogin, gitpod-runner-id), leaving all other project metadata untouched.

Migration

Existing deployments will see Terraform plan to destroy the google_compute_project_metadata resource and create two google_compute_project_metadata_item resources. The metadata values themselves don't change — only the Terraform resource type managing them.

⚠️ State migration: Customers who have already applied should run:

terraform state rm google_compute_project_metadata.runner_metadata

before the next terraform apply to avoid a brief metadata gap. Alternatively, just apply — the items will be recreated immediately.

Audit reference

Customer security audit item B1.

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>
@nandajavarma nandajavarma merged commit 223ca7e into main May 7, 2026
1 check passed
nandajavarma added a commit that referenced this pull request May 8, 2026
revert: restore google_compute_project_metadata (revert #24)
easyCZ pushed a commit that referenced this pull request May 21, 2026
fix: replace authoritative project metadata with non-authoritative items (B1)
easyCZ pushed a commit that referenced this pull request May 21, 2026
revert: restore google_compute_project_metadata (revert #24)
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.

2 participants