Skip to content

Commit 378aef7

Browse files
committed
Moving database_encryption variable under beta module
1 parent 055e896 commit 378aef7

20 files changed

+63
-58
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
116116
|------|-------------|:----:|:-----:|:-----:|
117117
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
118118
| basic\_auth\_username | The username to be used with Basic Authentication. An empty value will disable Basic Authentication, which is the recommended configuration. | string | `""` | no |
119-
| database\_encryption | Application-layer Secrets Encryption settings. Example: database_encryption = [{ state = "ENCRYPTED", key_name = "projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key" }] | list | `<list>` | no |
120119
| description | The description of the cluster | string | `""` | no |
121120
| disable\_legacy\_metadata\_endpoints | Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated. | string | `"true"` | no |
122121
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | string | `"true"` | no |
@@ -197,7 +196,6 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
197196
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
198197
#### Terraform and Plugins
199198
- [Terraform](https://www.terraform.io/downloads.html) 0.11.x
200-
- [terraform-provider-google-beta](https://github.com/terraform-providers/terraform-provider-google-beta) v2.3, v2.6, v2.7
201199
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) v2.3, v2.6, v2.7
202200

203201
### Configure a Service Account

autogen/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
143143
- [Terraform](https://www.terraform.io/downloads.html) 0.11.x
144144
{% if private_cluster or beta_cluster %}
145145
- [terraform-provider-google-beta](https://github.com/terraform-providers/terraform-provider-google-beta) v2.3, v2.6, v2.7
146+
{% else %}
146147
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) v2.3, v2.6, v2.7
148+
{% endif %}
147149

148150
### Configure a Service Account
149151
In order to execute this module you must have a Service Account with the

autogen/cluster_regional.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ resource "google_container_cluster" "primary" {
121121
}
122122
{% endif %}
123123
remove_default_node_pool = "${var.remove_default_node_pool}"
124+
{% if beta_cluster %}
124125
database_encryption = ["${var.database_encryption}"]
126+
{% endif %}
125127
}
126128

127129
/******************************************

autogen/cluster_zonal.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ resource "google_container_cluster" "zonal_primary" {
121121
}
122122
{% endif %}
123123
remove_default_node_pool = "${var.remove_default_node_pool}"
124+
{% if beta_cluster %}
124125
database_encryption = ["${var.database_encryption}"]
126+
{% endif %}
125127
}
126128

127129
/******************************************

autogen/variables.tf

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,21 @@ variable "cloudrun" {
284284
description = "(Beta) Enable CloudRun addon"
285285
default = false
286286
}
287+
288+
variable "database_encryption" {
289+
description = <<EOF
290+
Application-layer Secrets Encryption settings. Example:
291+
database_encryption = [{
292+
state = "ENCRYPTED",
293+
key_name = "projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key"
294+
}]
295+
EOF
296+
type = "list"
297+
default = [{
298+
state = "DECRYPTED"
299+
key_name = ""
300+
}]
301+
}
287302
{% endif %}
288303

289304
variable "basic_auth_username" {
@@ -299,19 +314,4 @@ variable "basic_auth_password" {
299314
variable "issue_client_certificate" {
300315
description = "Issues a client certificate to authenticate to the cluster endpoint. To maximize the security of your cluster, leave this option disabled. Client certificates don't automatically rotate and aren't easily revocable. WARNING: changing this after cluster creation is destructive!"
301316
default = "false"
302-
}
303-
304-
variable "database_encryption" {
305-
description = <<EOF
306-
Application-layer Secrets Encryption settings. Example:
307-
database_encryption = [{
308-
state = "ENCRYPTED",
309-
key_name = "projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key"
310-
}]
311-
EOF
312-
type = "list"
313-
default = [{
314-
state = "DECRYPTED"
315-
key_name = ""
316-
}]
317317
}

cluster_regional.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Create regional cluster
2121
*****************************************/
2222
resource "google_container_cluster" "primary" {
23-
provider = "google-beta"
23+
provider = "google"
2424
count = "${var.regional ? 1 : 0}"
2525
name = "${var.name}"
2626
description = "${var.description}"
@@ -101,7 +101,6 @@ resource "google_container_cluster" "primary" {
101101
}
102102
}
103103
remove_default_node_pool = "${var.remove_default_node_pool}"
104-
database_encryption = ["${var.database_encryption}"]
105104
}
106105

107106
/******************************************

cluster_zonal.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
Create zonal cluster
2121
*****************************************/
2222
resource "google_container_cluster" "zonal_primary" {
23-
provider = "google-beta"
23+
provider = "google"
2424
count = "${var.regional ? 0 : 1}"
2525
name = "${var.name}"
2626
description = "${var.description}"
@@ -101,7 +101,6 @@ resource "google_container_cluster" "zonal_primary" {
101101
}
102102
}
103103
remove_default_node_pool = "${var.remove_default_node_pool}"
104-
database_encryption = ["${var.database_encryption}"]
105104
}
106105

107106
/******************************************

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
124124
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
125125
| basic\_auth\_username | The username to be used with Basic Authentication. An empty value will disable Basic Authentication, which is the recommended configuration. | string | `""` | no |
126126
| cloudrun | (Beta) Enable CloudRun addon | string | `"false"` | no |
127+
| database\_encryption | Application-layer Secrets Encryption settings. Example: database_encryption = [{ state = "ENCRYPTED", key_name = "projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key" }] | list | `<list>` | no |
127128
| deploy\_using\_private\_endpoint | (Beta) A toggle for Terraform and kubectl to connect to the master's internal IP address during deployment. | string | `"false"` | no |
128129
| description | The description of the cluster | string | `""` | no |
129130
| disable\_legacy\_metadata\_endpoints | Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated. | string | `"true"` | no |

modules/beta-private-cluster/cluster_regional.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ resource "google_container_cluster" "primary" {
115115
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
116116
}
117117
remove_default_node_pool = "${var.remove_default_node_pool}"
118+
database_encryption = ["${var.database_encryption}"]
118119
}
119120

120121
/******************************************

modules/beta-private-cluster/cluster_zonal.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ resource "google_container_cluster" "zonal_primary" {
115115
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
116116
}
117117
remove_default_node_pool = "${var.remove_default_node_pool}"
118+
database_encryption = ["${var.database_encryption}"]
118119
}
119120

120121
/******************************************

0 commit comments

Comments
 (0)