Skip to content

Commit e5138c9

Browse files
feat: add secret manager add-on config
Co-authored-by: Jayanta Dutta <jayanta.dutta@billhop.com>
1 parent 72cf873 commit e5138c9

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,13 @@ resource "google_container_cluster" "primary" {
221221
{% if beta_cluster %}
222222
enable_intranode_visibility = var.enable_intranode_visibility
223223

224+
dynamic "secret_manager_config" {
225+
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
226+
content {
227+
enabled = secret_manager_config.value
228+
}
229+
}
230+
224231
dynamic "pod_security_policy_config" {
225232
for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : []
226233
content {

autogen/main/main.tf.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ locals {
169169
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
170170
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
171171
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
172+
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
172173

173174
# /BETA features
174175
{% endif %}
@@ -239,6 +240,7 @@ locals {
239240
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
240241
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
241242
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
243+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
242244

243245
# /BETA features
244246
{% endif %}

autogen/main/outputs.tf.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ output "identity_service_enabled" {
233233
description = "Whether Identity Service is enabled"
234234
value = local.cluster_identity_service_enabled
235235
}
236+
237+
output "secret_manager_addon_enabled" {
238+
description = "Whether Secret Manager add-on is enabled"
239+
value = local.cluster_secret_manager_addon_enabled
240+
}
236241
{% endif %}
237242

238243
output "fleet_membership" {

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,12 @@ variable "enable_pod_security_policy" {
862862
default = false
863863
}
864864

865+
variable "enable_secret_manager_addon" {
866+
description = "(Beta) Enable the Secret Manager add-on for this cluster"
867+
type = bool
868+
default = false
869+
}
870+
865871
variable "sandbox_enabled" {
866872
type = bool
867873
description = "(Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` to use it)."

0 commit comments

Comments
 (0)