Skip to content

feat: extend secret_sync_config to GA modules and add rotation_config support#2596

Open
litzius wants to merge 6 commits into
terraform-google-modules:mainfrom
litzius:feat/secret-sync-config-ga-rotation
Open

feat: extend secret_sync_config to GA modules and add rotation_config support#2596
litzius wants to merge 6 commits into
terraform-google-modules:mainfrom
litzius:feat/secret-sync-config-ga-rotation

Conversation

@litzius

@litzius litzius commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Follows up on feat: Add secret_sync_config support to all beta cluster modules #2573 which added secret_sync_config to beta modules
  • Extends secret_sync_config to all remaining cluster modules now that the block is GA in google provider
    v7.33.0 — root module, private-cluster, and private-cluster-update-variant were
    previously excluded
  • Adds rotation_config sub-block to secret_sync_config across all modules (enabled, rotation_interval), enabling automatic secret rotation for the Secret Sync add-on
  • Renames enable_secret_sync (bool) → secret_sync_config (object) in autogen-based modules for consistency with the handwritten gke-* modules pattern — breaking change
  • Bumps non-beta google provider minimum to >= 7.33.0 (GA release); bumps google-beta minimum to >= 7.12.0 in gke-standard-cluster and gke-autopilot-cluster (secret_sync_config + rotation_config landed in beta 7.12.0)
  • Autogen templates (autogen/main/, autogen/safer-cluster/) updated; {% if beta_cluster %} guard removed from secret_sync_config block

Affected modules

Module Variable Change
private-cluster secret_sync_config New
private-cluster-update-variant secret_sync_config New
root module secret_sync_config New
beta-private-cluster secret_sync_config Renamed from enable_secret_sync + rotation_config added
beta-private-cluster-update-variant secret_sync_config Renamed + rotation_config added
beta-public-cluster secret_sync_config Renamed + rotation_config added
beta-public-cluster-update-variant secret_sync_config Renamed + rotation_config added
beta-autopilot-private-cluster secret_sync_config Renamed + rotation_config added
beta-autopilot-public-cluster secret_sync_config Renamed + rotation_config added
safer-cluster secret_sync_config Renamed pass-through + rotation_config added
safer-cluster-update-variant secret_sync_config Renamed pass-through + rotation_config added
gke-standard-cluster secret_sync_config rotation_config added
gke-autopilot-cluster secret_sync_config rotation_config added

Breaking change

Beta modules that previously used enable_secret_sync = true must now use:

secret_sync_config = { enabled = true }

Test plan

  • terraform validate passes on root module and private-cluster (with google provider upgraded to 7.33+)
  • make build run — modules regenerated from autogen templates and all README Inputs/Outputs tables updated
  • google provider >= 7.33.0 required for root, private-cluster, private-cluster-update-variant
  • google-beta provider >= 7.12.0 required for gke-standard-cluster, gke-autopilot-cluster
  • Beta autogen modules already required >= 7.17.0, no change needed

… support

  - Remove {% if beta_cluster %} guard from autogen templates so secret_sync_config
    is now generated for all modules (root, private-cluster, private-cluster-update-variant)
    now that google provider >= 7.33 exposes it as GA
  - Rename enable_secret_sync (bool) → secret_sync_config (object) in autogen and
    safer-cluster templates for consistency with gke-* modules (breaking change)
  - Add rotation_config sub-block (enabled, rotation_interval) to secret_sync_config
    across all modules including gke-standard-cluster and gke-autopilot-cluster
  - Bump non-beta google provider minimum to >= 7.33.0 in versions.tf.tmpl
  - Regenerate all autogen-derived modules and READMEs via make build

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the boolean enable_secret_sync variable with a structured secret_sync_config object across various GKE cluster modules, allowing for advanced configuration including secret rotation. The minimum Google provider version is also updated to >= 7.33.0 to support this block. The review feedback correctly identifies that the enabled attribute within the rotation_config object should not be marked as optional(bool) since it is a required field in the Google provider schema when rotation_config is defined. This issue needs to be addressed across several variable definition files, and the minimum provider version should be consistently updated in the autopilot and standard cluster modules.

Comment thread autogen/main/variables.tf.tmpl
Comment thread autogen/safer-cluster/variables.tf.tmpl
Comment thread modules/gke-standard-cluster/variables.tf
Comment thread modules/gke-autopilot-cluster/variables.tf
@litzius

litzius commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates GKE cluster configurations across multiple modules to support the secret_sync_config block, including its nested rotation_config settings. Feedback from the review highlights critical issues with the updated provider versions, noting that the specified google version 7.33.0 and google-beta version 7.12.0 do not exist and will cause initialization failures. Additionally, the reviewer pointed out that the enabled field within rotation_config should be marked as required rather than optional in the variable definitions to prevent runtime errors during deployment.

Comment thread autogen/main/versions.tf.tmpl
Comment thread versions.tf
Comment thread modules/gke-autopilot-cluster/versions.tf
Comment thread modules/gke-standard-cluster/versions.tf
Comment thread autogen/main/variables.tf.tmpl
Comment thread variables.tf
Comment thread modules/gke-standard-cluster/variables.tf
Comment thread modules/gke-autopilot-cluster/variables.tf
@litzius litzius marked this pull request as ready for review May 28, 2026 21:11
@apeabody

Copy link
Copy Markdown
Contributor

/gcbrun

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