feat(google_gke): expose node_pools_metadata for set-once node metadata#477
Merged
Conversation
Adds a `node_pools_metadata` variable (per-pool map of key/value strings)
that's threaded into `google_container_node_pool.pools.node_config.metadata`.
The module already has `node_config[0].metadata` in `lifecycle.ignore_changes`
(intentional — GKE auto-populates metadata keys we don't want terraform to
fight), so this exposure is create-time-only by design.
Use case: SoC2 hardening settings like `serial-port-logging-enable=false`
that we want to seed at pool creation and never change afterward. Updating
the variable on an existing pool will NOT propagate; pool rotation is
required to change the value. Variable description warns about this.
Existing consumers see no plan diff — when a pool has no metadata entry,
the local projection yields `{}` and the conditional in cluster.tf sets
`metadata = null`, which terraform treats as "attribute omitted."
MZCLD-3238.
Contributor
Release plan
|
jasonthomas
approved these changes
Jun 4, 2026
jbuck
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
node_pools_metadatavariable (per-pool map of key/value strings) that's threaded intogoogle_container_node_pool.pools.node_config.metadata. The module already hasnode_config[0].metadatainlifecycle.ignore_changes(intentional — GKE auto-populates metadata keys we don't want terraform to fight), so this exposure is create-time-only by design.Use case: SoC2 hardening settings like
serial-port-logging-enable=falsethat we want to seed at pool creation and never change afterward. Updating the variable on an existing pool will NOT propagate; pool rotation is required to change the value. Variable description warns about this.Existing consumers see no plan diff — when a pool has no metadata entry, the local projection yields
{}and the conditional in cluster.tf setsmetadata = null, which terraform treats as "attribute omitted."Related Tickets & Documents