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
/******************************************

modules/beta-private-cluster/variables.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,23 @@ variable "cloudrun" {
280280
default = false
281281
}
282282

283+
variable "database_encryption" {
284+
description = <<EOF
285+
Application-layer Secrets Encryption settings. Example:
286+
database_encryption = [{
287+
state = "ENCRYPTED",
288+
key_name = "projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key"
289+
}]
290+
EOF
291+
292+
type = "list"
293+
294+
default = [{
295+
state = "DECRYPTED"
296+
key_name = ""
297+
}]
298+
}
299+
283300
variable "basic_auth_username" {
284301
description = "The username to be used with Basic Authentication. An empty value will disable Basic Authentication, which is the recommended configuration."
285302
default = ""

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
119119
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
120120
| 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 |
121121
| cloudrun | (Beta) Enable CloudRun addon | string | `"false"` | no |
122+
| 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 |
122123
| description | The description of the cluster | string | `""` | no |
123124
| 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 |
124125
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | string | `"true"` | no |

modules/beta-public-cluster/cluster_regional.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ resource "google_container_cluster" "primary" {
108108
}
109109
}
110110
remove_default_node_pool = "${var.remove_default_node_pool}"
111+
database_encryption = ["${var.database_encryption}"]
111112
}
112113

113114
/******************************************

modules/beta-public-cluster/cluster_zonal.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ resource "google_container_cluster" "zonal_primary" {
108108
}
109109
}
110110
remove_default_node_pool = "${var.remove_default_node_pool}"
111+
database_encryption = ["${var.database_encryption}"]
111112
}
112113

113114
/******************************************

modules/beta-public-cluster/variables.tf

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ variable "service_account" {
237237
default = "create"
238238
}
239239

240-
241240
variable "istio" {
242241
description = "(Beta) Enable Istio addon"
243242
default = false
@@ -248,6 +247,23 @@ variable "cloudrun" {
248247
default = false
249248
}
250249

250+
variable "database_encryption" {
251+
description = <<EOF
252+
Application-layer Secrets Encryption settings. Example:
253+
database_encryption = [{
254+
state = "ENCRYPTED",
255+
key_name = "projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key"
256+
}]
257+
EOF
258+
259+
type = "list"
260+
261+
default = [{
262+
state = "DECRYPTED"
263+
key_name = ""
264+
}]
265+
}
266+
251267
variable "basic_auth_username" {
252268
description = "The username to be used with Basic Authentication. An empty value will disable Basic Authentication, which is the recommended configuration."
253269
default = ""

modules/private-cluster/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
121121
|------|-------------|:----:|:-----:|:-----:|
122122
| basic\_auth\_password | The password to be used with Basic Authentication. | string | `""` | no |
123123
| 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 |
124-
| 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 |
125124
| 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 |
126125
| description | The description of the cluster | string | `""` | no |
127126
| 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 |
@@ -210,7 +209,6 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
210209
#### Terraform and Plugins
211210
- [Terraform](https://www.terraform.io/downloads.html) 0.11.x
212211
- [terraform-provider-google-beta](https://github.com/terraform-providers/terraform-provider-google-beta) v2.3, v2.6, v2.7
213-
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) v2.3, v2.6, v2.7
214212

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

modules/private-cluster/cluster_regional.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ resource "google_container_cluster" "primary" {
108108
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
109109
}
110110
remove_default_node_pool = "${var.remove_default_node_pool}"
111-
database_encryption = ["${var.database_encryption}"]
112111
}
113112

114113
/******************************************

modules/private-cluster/cluster_zonal.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ resource "google_container_cluster" "zonal_primary" {
108108
master_ipv4_cidr_block = "${var.master_ipv4_cidr_block}"
109109
}
110110
remove_default_node_pool = "${var.remove_default_node_pool}"
111-
database_encryption = ["${var.database_encryption}"]
112111
}
113112

114113
/******************************************

modules/private-cluster/variables.tf

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -284,20 +284,3 @@ variable "issue_client_certificate" {
284284
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!"
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-
297-
type = "list"
298-
299-
default = [{
300-
state = "DECRYPTED"
301-
key_name = ""
302-
}]
303-
}

variables.tf

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -252,19 +252,4 @@ variable "basic_auth_password" {
252252
variable "issue_client_certificate" {
253253
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!"
254254
default = "false"
255-
}
256-
257-
variable "database_encryption" {
258-
description = <<EOF
259-
Application-layer Secrets Encryption settings. Example:
260-
database_encryption = [{
261-
state = "ENCRYPTED",
262-
key_name = "projects/my-project/locations/global/keyRings/my-ring/cryptoKeys/my-key"
263-
}]
264-
EOF
265-
type = "list"
266-
default = [{
267-
state = "DECRYPTED"
268-
key_name = ""
269-
}]
270255
}

0 commit comments

Comments
 (0)