Skip to content

Commit

Permalink
feat: add secret manager add-on config
Browse files Browse the repository at this point in the history
Co-authored-by: Jayanta Dutta <[email protected]>
  • Loading branch information
legal90 and jayanta-dutta committed Jun 22, 2024
1 parent a6210fc commit 7fd8d13
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ resource "google_container_cluster" "primary" {
{% if beta_cluster %}
enable_intranode_visibility = var.enable_intranode_visibility

dynamic "secret_manager_config" {
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
content {
enabled = secret_manager_config.value
}
}

dynamic "pod_security_policy_config" {
for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : []
content {
Expand Down
2 changes: 2 additions & 0 deletions autogen/main/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ locals {
cluster_output_pod_security_policy_enabled = google_container_cluster.primary.pod_security_policy_config != null && length(google_container_cluster.primary.pod_security_policy_config) == 1 ? google_container_cluster.primary.pod_security_policy_config[0].enabled : false
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
cluster_output_identity_service_enabled = google_container_cluster.primary.identity_service_config != null && length(google_container_cluster.primary.identity_service_config) == 1 ? google_container_cluster.primary.identity_service_config[0].enabled : false
cluster_output_secret_manager_addon_enabled = google_container_cluster.primary.secret_manager_config != null && length(google_container_cluster.primary.secret_manager_config) == 1 ? google_container_cluster.primary.secret_manager_config[0].enabled : false

# /BETA features
{% endif %}
Expand Down Expand Up @@ -239,6 +240,7 @@ locals {
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled

# /BETA features
{% endif %}
Expand Down
5 changes: 5 additions & 0 deletions autogen/main/outputs.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,11 @@ output "identity_service_enabled" {
description = "Whether Identity Service is enabled"
value = local.cluster_identity_service_enabled
}

output "secret_manager_addon_enabled" {
description = "Whether Secret Manager add-on is enabled"
value = local.cluster_secret_manager_addon_enabled
}
{% endif %}

output "fleet_membership" {
Expand Down
6 changes: 6 additions & 0 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,12 @@ variable "enable_pod_security_policy" {
default = false
}

variable "enable_secret_manager_addon" {
description = "(Beta) Enable the Secret Manager add-on for this cluster"
type = bool
default = false
}

variable "sandbox_enabled" {
type = bool
description = "(Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` to use it)."
Expand Down

0 comments on commit 7fd8d13

Please sign in to comment.