Skip to content

Commit 966135f

Browse files
authored
feat!: promote gke_backup_agent_config to ga (terraform-google-modules#1513)
1 parent d7f71f6 commit 966135f

File tree

40 files changed

+136
-86
lines changed

40 files changed

+136
-86
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Then perform the following commands on the root folder:
158158
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
159159
| gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. | `string` | `null` | no |
160160
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
161+
| gke\_backup\_agent\_config | Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
161162
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
162163
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
163164
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |

autogen/main/cluster.tf.tmpl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,14 @@ resource "google_container_cluster" "primary" {
259259
enabled = gce_persistent_disk_csi_driver_config.value.enabled
260260
}
261261
}
262+
263+
dynamic "gke_backup_agent_config" {
264+
for_each = local.gke_backup_agent_config
265+
266+
content {
267+
enabled = gke_backup_agent_config.value.enabled
268+
}
269+
}
262270
{% endif %}
263271
{% if beta_cluster and autopilot_cluster != true %}
264272

@@ -282,14 +290,6 @@ resource "google_container_cluster" "primary" {
282290
config_connector_config {
283291
enabled = var.config_connector
284292
}
285-
286-
dynamic "gke_backup_agent_config" {
287-
for_each = local.gke_backup_agent_config
288-
289-
content {
290-
enabled = gke_backup_agent_config.value.enabled
291-
}
292-
}
293293
{% endif %}
294294
}
295295

autogen/main/main.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ locals {
103103
}]
104104
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
105105
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
106+
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
106107
{% endif %}
107108
{% if beta_cluster and autopilot_cluster != true %}
108109
cluster_cloudrun_config_load_balancer_config = (var.cloudrun && var.cloudrun_load_balancer_type != "") ? {
@@ -117,7 +118,6 @@ locals {
117118
)
118119
] : []
119120
cluster_cloudrun_enabled = var.cloudrun
120-
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
121121
{% endif %}
122122

123123
cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,12 @@ variable "gce_pd_csi_driver" {
641641
default = true
642642
}
643643

644+
variable "gke_backup_agent_config" {
645+
type = bool
646+
description = "Whether Backup for GKE agent is enabled for this cluster."
647+
default = false
648+
}
649+
644650
{% endif %}
645651
variable "timeouts" {
646652
type = map(string)
@@ -703,12 +709,6 @@ variable "config_connector" {
703709
default = false
704710
}
705711

706-
variable "gke_backup_agent_config" {
707-
type = bool
708-
description = "(Beta) Whether Backup for GKE agent is enabled for this cluster."
709-
default = false
710-
}
711-
712712
variable "cloudrun" {
713713
description = "(Beta) Enable CloudRun addon"
714714
default = false

autogen/main/versions.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ terraform {
2424
required_providers {
2525
google-beta = {
2626
source = "hashicorp/google-beta"
27-
version = ">= 4.46.0, < 5.0"
27+
version = ">= 4.47.0, < 5.0"
2828
}
2929
kubernetes = {
3030
source = "hashicorp/kubernetes"

cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ resource "google_container_cluster" "primary" {
184184
enabled = gce_persistent_disk_csi_driver_config.value.enabled
185185
}
186186
}
187+
188+
dynamic "gke_backup_agent_config" {
189+
for_each = local.gke_backup_agent_config
190+
191+
content {
192+
enabled = gke_backup_agent_config.value.enabled
193+
}
194+
}
187195
}
188196

189197
datapath_provider = var.datapath_provider

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ locals {
8585
}]
8686
cluster_gce_pd_csi_config = var.gce_pd_csi_driver ? [{ enabled = true }] : [{ enabled = false }]
8787
logmon_config_is_set = length(var.logging_enabled_components) > 0 || length(var.monitoring_enabled_components) > 0 || var.monitoring_enable_managed_prometheus
88+
gke_backup_agent_config = var.gke_backup_agent_config ? [{ enabled = true }] : [{ enabled = false }]
8889

8990
cluster_authenticator_security_group = var.authenticator_security_group == null ? [] : [{
9091
security_group = var.authenticator_security_group

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ terraform {
2121
required_providers {
2222
google-beta = {
2323
source = "hashicorp/google-beta"
24-
version = ">= 4.46.0, < 5.0"
24+
version = ">= 4.47.0, < 5.0"
2525
}
2626
kubernetes = {
2727
source = "hashicorp/kubernetes"

modules/beta-autopilot-public-cluster/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ terraform {
2121
required_providers {
2222
google-beta = {
2323
source = "hashicorp/google-beta"
24-
version = ">= 4.46.0, < 5.0"
24+
version = ">= 4.47.0, < 5.0"
2525
}
2626
kubernetes = {
2727
source = "hashicorp/kubernetes"

modules/beta-private-cluster-update-variant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ Then perform the following commands on the root folder:
203203
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
204204
| gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. | `string` | `null` | no |
205205
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
206-
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
206+
| gke\_backup\_agent\_config | Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
207207
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
208208
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
209209
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |

0 commit comments

Comments
 (0)