Skip to content

Commit ccddbe6

Browse files
code review changes
1 parent f123a0c commit ccddbe6

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

examples/confidential_autopilot_private/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Confidential Autopilot Private Cluster
22

3-
This example illustrates how to create a autopilot cluster with beta features,
4-
using Confidential Nodes and a Customer Managed Encryption Keys (CMEK).
3+
This example illustrates how to create an Autopilot cluster with beta features,
4+
using Confidential GKE nodes and a Customer Managed Encryption Keys (CMEK).
55

66
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
77
## Inputs
@@ -17,7 +17,7 @@ using Confidential Nodes and a Customer Managed Encryption Keys (CMEK).
1717
| cluster\_name | Cluster name |
1818
| kms\_key | CMEK used for disk and database encryption |
1919
| kubernetes\_endpoint | The cluster endpoint |
20-
| location | n/a |
20+
| location | Cluster location (region if regional cluster, zone if zonal cluster) |
2121
| master\_kubernetes\_version | Kubernetes version of the master |
2222
| network\_name | The name of the VPC being created |
2323
| region | The region in which the cluster resides |

examples/confidential_autopilot_private/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module "kms" {
4040

4141
project_id = var.project_id
4242
key_protection_level = "HSM"
43-
location = "us-central1"
43+
location = var.region
4444
keyring = "keyring-${random_string.suffix.result}"
4545
keys = ["key"]
4646
prevent_destroy = false
@@ -59,7 +59,7 @@ module "gke" {
5959
project_id = var.project_id
6060
name = "${local.cluster_type}-cluster"
6161
regional = true
62-
region = "us-central1"
62+
region = var.region
6363
network = module.gcp-network.network_name
6464
subnetwork = local.subnet_names[index(module.gcp-network.subnets_names, local.subnet_name)]
6565
ip_range_pods = local.pods_range_name

examples/confidential_autopilot_private/network.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
module "gcp-network" {
1818
source = "terraform-google-modules/network/google"
19-
version = ">= 7.5"
19+
version = "~= 10.0"
2020

2121
project_id = var.project_id
2222
network_name = local.network_name
@@ -25,13 +25,13 @@ module "gcp-network" {
2525
{
2626
subnet_name = local.subnet_name
2727
subnet_ip = "10.0.0.0/17"
28-
subnet_region = "us-central1"
28+
subnet_region = var.region
2929
subnet_private_access = true
3030
},
3131
{
3232
subnet_name = local.master_auth_subnetwork
3333
subnet_ip = "10.60.0.0/17"
34-
subnet_region = "us-central1"
34+
subnet_region = var.region
3535
},
3636
]
3737

examples/confidential_autopilot_private/outputs.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ output "cluster_name" {
2626
}
2727

2828
output "location" {
29-
value = module.gke.location
29+
description = "Cluster location (region if regional cluster, zone if zonal cluster)"
30+
value = module.gke.location
3031
}
3132

3233
output "master_kubernetes_version" {

examples/confidential_autopilot_private/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@
1616

1717
variable "project_id" {
1818
description = "The project ID to host the cluster in"
19+
type = string
20+
}
21+
22+
variable "region" {
23+
description = "The region to host the cluster in"
24+
type = string
25+
default = "us-central1"
1926
}

0 commit comments

Comments
 (0)