Skip to content

Commit d28c9d0

Browse files
committed
feat(TPG>=6.1.0): promote secret_manager_config to GA
Promote `secret_manager_config` (GA since 6.1.) https://github.com/hashicorp/terraform-provider-google/releases/tag/v6.1.0 Fixes #2157
1 parent f3e2e59 commit d28c9d0

File tree

43 files changed

+197
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+197
-131
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ Then perform the following commands on the root folder:
173173
| enable\_mesh\_certificates | Controls the issuance of workload mTLS certificates. When enabled the GKE Workload Identity Certificates controller and node agent will be deployed in the cluster. Requires Workload Identity. | `bool` | `false` | no |
174174
| enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no |
175175
| enable\_resource\_consumption\_export | Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. | `bool` | `true` | no |
176+
| enable\_secret\_manager\_addon | Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
176177
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
177178
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
178179
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
@@ -282,6 +283,7 @@ Then perform the following commands on the root folder:
282283
| node\_pools\_versions | Node pool versions by node pool name |
283284
| region | Cluster region |
284285
| release\_channel | The release channel of this cluster |
286+
| secret\_manager\_addon\_enabled | Whether Secret Manager add-on is enabled |
285287
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
286288
| tpu\_ipv4\_cidr\_block | The IP range in CIDR notation used for the TPUs |
287289
| type | Cluster type (regional / zonal) |

autogen/main/cluster.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,14 @@ resource "google_container_cluster" "primary" {
243243

244244
enable_cilium_clusterwide_network_policy = var.enable_cilium_clusterwide_network_policy
245245

246-
{% if beta_cluster %}
247246
dynamic "secret_manager_config" {
248247
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
249248
content {
250249
enabled = secret_manager_config.value
251250
}
252251
}
253252

253+
{% if beta_cluster %}
254254
enable_fqdn_network_policy = var.enable_fqdn_network_policy
255255
{% endif %}
256256
{% if autopilot_cluster %}

autogen/main/main.tf.tmpl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ locals {
165165
cluster_output_vertical_pod_autoscaling_enabled = google_container_cluster.primary.vertical_pod_autoscaling != null && length(google_container_cluster.primary.vertical_pod_autoscaling) == 1 ? google_container_cluster.primary.vertical_pod_autoscaling[0].enabled : false
166166
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
167167
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
168+
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
168169

169170
{% if beta_cluster %}
170171
# BETA features
171-
cluster_output_istio_disabled = google_container_cluster.primary.addons_config[0].istio_config != null && length(google_container_cluster.primary.addons_config[0].istio_config) == 1 ? google_container_cluster.primary.addons_config[0].istio_config[0].disabled : false
172-
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
173-
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
172+
cluster_output_istio_disabled = google_container_cluster.primary.addons_config[0].istio_config != null && length(google_container_cluster.primary.addons_config[0].istio_config) == 1 ? google_container_cluster.primary.addons_config[0].istio_config[0].disabled : false
173+
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
174174

175175
# /BETA features
176176
{% endif %}
@@ -223,6 +223,7 @@ locals {
223223
confidential_node_config = var.enable_confidential_nodes == true ? [{ enabled = true }] : []
224224
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
225225
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
226+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
226227
{% if autopilot_cluster != true %}
227228
cluster_mesh_certificates_config = local.workload_identity_enabled ? [{
228229
enable_certificates = var.enable_mesh_certificates
@@ -231,12 +232,11 @@ locals {
231232

232233
{% if beta_cluster %}
233234
# BETA features
234-
cluster_istio_enabled = ! local.cluster_output_istio_disabled
235+
cluster_istio_enabled = !local.cluster_output_istio_disabled
235236
{% if autopilot_cluster != true %}
236-
cluster_telemetry_type_is_set = var.cluster_telemetry_type != null
237+
cluster_telemetry_type_is_set = var.cluster_telemetry_type != null
237238
{% endif %}
238-
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
239-
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
239+
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
240240

241241
# /BETA features
242242
{% endif %}

autogen/main/outputs.tf.tmpl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,6 @@ output "pod_security_policy_enabled" {
223223
description = "Whether pod security policy is enabled"
224224
value = local.cluster_pod_security_policy_enabled
225225
}
226-
227-
output "secret_manager_addon_enabled" {
228-
description = "Whether Secret Manager add-on is enabled"
229-
value = local.cluster_secret_manager_addon_enabled
230-
}
231226
{% endif %}
232227

233228
output "identity_service_enabled" {
@@ -240,6 +235,11 @@ output "intranode_visibility_enabled" {
240235
value = local.cluster_intranode_visibility_enabled
241236
}
242237

238+
output "secret_manager_addon_enabled" {
239+
description = "Whether Secret Manager add-on is enabled"
240+
value = local.cluster_secret_manager_addon_enabled
241+
}
242+
243243
output "fleet_membership" {
244244
description = "Fleet membership (if registered)"
245245
value = local.fleet_membership

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,12 @@ variable "enable_confidential_nodes" {
611611
description = "An optional flag to enable confidential node config."
612612
default = false
613613
}
614+
615+
variable "enable_secret_manager_addon" {
616+
description = "Enable the Secret Manager add-on for this cluster"
617+
type = bool
618+
default = false
619+
}
614620
{% if beta_cluster %}
615621

616622
variable "workload_vulnerability_mode" {
@@ -630,12 +636,6 @@ variable "enable_fqdn_network_policy" {
630636
description = "Enable FQDN Network Policies on the cluster"
631637
default = null
632638
}
633-
634-
variable "enable_secret_manager_addon" {
635-
description = "(Beta) Enable the Secret Manager add-on for this cluster"
636-
type = bool
637-
default = false
638-
}
639639
{% endif %}
640640

641641
variable "enable_cilium_clusterwide_network_policy" {

cluster.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ resource "google_container_cluster" "primary" {
189189

190190
enable_cilium_clusterwide_network_policy = var.enable_cilium_clusterwide_network_policy
191191

192+
dynamic "secret_manager_config" {
193+
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
194+
content {
195+
enabled = secret_manager_config.value
196+
}
197+
}
198+
192199
dynamic "master_authorized_networks_config" {
193200
for_each = var.gcp_public_cidrs_access_enabled != null || length(var.master_authorized_networks) > 0 ? [true] : []
194201
content {

main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ locals {
125125
cluster_output_vertical_pod_autoscaling_enabled = google_container_cluster.primary.vertical_pod_autoscaling != null && length(google_container_cluster.primary.vertical_pod_autoscaling) == 1 ? google_container_cluster.primary.vertical_pod_autoscaling[0].enabled : false
126126
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
127127
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
128+
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
128129

129130
cluster_output_node_pools_names = concat(
130131
[for np in google_container_node_pool.pools : np.name], [""],
@@ -166,6 +167,7 @@ locals {
166167
confidential_node_config = var.enable_confidential_nodes == true ? [{ enabled = true }] : []
167168
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
168169
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
170+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
169171
cluster_mesh_certificates_config = local.workload_identity_enabled ? [{
170172
enable_certificates = var.enable_mesh_certificates
171173
}] : []

modules/beta-autopilot-private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Then perform the following commands on the root folder:
9999
| enable\_private\_endpoint | Whether the master's internal IP address is used as the cluster endpoint | `bool` | `false` | no |
100100
| enable\_private\_nodes | Whether nodes have internal IP addresses only | `bool` | `true` | no |
101101
| enable\_resource\_consumption\_export | Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. | `bool` | `true` | no |
102-
| enable\_secret\_manager\_addon | (Beta) Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
102+
| enable\_secret\_manager\_addon | Enable the Secret Manager add-on for this cluster | `bool` | `false` | no |
103103
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
104104
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `true` | no |
105105
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |

modules/beta-autopilot-private-cluster/main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ locals {
9393
cluster_output_vertical_pod_autoscaling_enabled = google_container_cluster.primary.vertical_pod_autoscaling != null && length(google_container_cluster.primary.vertical_pod_autoscaling) == 1 ? google_container_cluster.primary.vertical_pod_autoscaling[0].enabled : false
9494
cluster_output_intranode_visbility_enabled = google_container_cluster.primary.enable_intranode_visibility
9595
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
96+
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
9697

9798
# BETA features
98-
cluster_output_istio_disabled = google_container_cluster.primary.addons_config[0].istio_config != null && length(google_container_cluster.primary.addons_config[0].istio_config) == 1 ? google_container_cluster.primary.addons_config[0].istio_config[0].disabled : false
99-
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
100-
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
99+
cluster_output_istio_disabled = google_container_cluster.primary.addons_config[0].istio_config != null && length(google_container_cluster.primary.addons_config[0].istio_config) == 1 ? google_container_cluster.primary.addons_config[0].istio_config[0].disabled : false
100+
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
101101

102102
# /BETA features
103103

@@ -127,11 +127,11 @@ locals {
127127
confidential_node_config = var.enable_confidential_nodes == true ? [{ enabled = true }] : []
128128
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
129129
cluster_identity_service_enabled = local.cluster_output_identity_service_enabled
130+
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
130131

131132
# BETA features
132-
cluster_istio_enabled = !local.cluster_output_istio_disabled
133-
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
134-
cluster_secret_manager_addon_enabled = local.cluster_output_secret_manager_addon_enabled
133+
cluster_istio_enabled = !local.cluster_output_istio_disabled
134+
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
135135

136136
# /BETA features
137137

modules/beta-autopilot-private-cluster/outputs.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,6 @@ output "pod_security_policy_enabled" {
179179
value = local.cluster_pod_security_policy_enabled
180180
}
181181

182-
output "secret_manager_addon_enabled" {
183-
description = "Whether Secret Manager add-on is enabled"
184-
value = local.cluster_secret_manager_addon_enabled
185-
}
186-
187182
output "identity_service_enabled" {
188183
description = "Whether Identity Service is enabled"
189184
value = local.cluster_identity_service_enabled
@@ -194,6 +189,11 @@ output "intranode_visibility_enabled" {
194189
value = local.cluster_intranode_visibility_enabled
195190
}
196191

192+
output "secret_manager_addon_enabled" {
193+
description = "Whether Secret Manager add-on is enabled"
194+
value = local.cluster_secret_manager_addon_enabled
195+
}
196+
197197
output "fleet_membership" {
198198
description = "Fleet membership (if registered)"
199199
value = local.fleet_membership

0 commit comments

Comments
 (0)