Skip to content

Commit e379b59

Browse files
committed
default gcloud module to ADC, expose via var
1 parent f720648 commit e379b59

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

modules/asm/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ To deploy this config:
4343
| cluster\_endpoint | The GKE cluster endpoint. | string | n/a | yes |
4444
| cluster\_name | The unique name to identify the cluster in ASM. | string | n/a | yes |
4545
| enable\_gke\_hub\_registration | Enables GKE Hub Registration when set to true | bool | `"true"` | no |
46+
| gcloud\_sdk\_version | The gcloud sdk version to use. Minimum required version is 293.0.0 | string | `"294.0.0"` | no |
4647
| gke\_hub\_membership\_name | Memebership name that uniquely represents the cluster being registered on the Hub | string | `"gke-asm-membership"` | no |
4748
| gke\_hub\_sa\_name | Name for the GKE Hub SA stored as a secret `creds-gcp` in the `gke-connect` namespace. | string | `"gke-hub-sa"` | no |
4849
| location | The location (zone or region) this cluster has been created in. | string | n/a | yes |
4950
| project\_id | The project in which the resource belongs. | string | n/a | yes |
5051
| skip\_gcloud\_download | Whether to skip downloading gcloud (assumes gcloud and kubectl already available outside the module) | bool | `"true"` | no |
52+
| use\_tf\_google\_credentials\_env\_var | Optional GOOGLE_CREDENTIALS environment variable to be activated. | bool | `"false"` | no |
5153

5254
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

modules/asm/main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ module "asm_install" {
3333
module_depends_on = [var.cluster_endpoint]
3434

3535
platform = "linux"
36-
gcloud_sdk_version = "293.0.0"
36+
gcloud_sdk_version = var.gcloud_sdk_version
3737
skip_download = var.skip_gcloud_download
38-
upgrade = false
39-
use_tf_google_credentials_env_var = true
38+
upgrade = true
39+
use_tf_google_credentials_env_var = var.use_tf_google_credentials_env_var
4040
additional_components = ["kubectl", "kpt", "anthoscli", "alpha"]
4141

4242
create_cmd_entrypoint = "${path.module}/scripts/install_asm.sh"
@@ -68,11 +68,11 @@ module "gke_hub_registration" {
6868
version = "~> 1.0"
6969

7070
platform = "linux"
71-
gcloud_sdk_version = "293.0.0"
71+
gcloud_sdk_version = var.gcloud_sdk_version
7272
skip_download = var.skip_gcloud_download
73-
upgrade = false
73+
upgrade = true
7474
enabled = var.enable_gke_hub_registration
75-
use_tf_google_credentials_env_var = true
75+
use_tf_google_credentials_env_var = var.use_tf_google_credentials_env_var
7676
module_depends_on = [module.asm_install.wait]
7777

7878
create_cmd_entrypoint = "${path.module}/scripts/gke_hub_registration.sh"

modules/asm/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ variable "skip_gcloud_download" {
4040
default = true
4141
}
4242

43+
variable "use_tf_google_credentials_env_var" {
44+
description = "Optional GOOGLE_CREDENTIALS environment variable to be activated."
45+
type = bool
46+
default = false
47+
}
48+
49+
variable "gcloud_sdk_version" {
50+
description = "The gcloud sdk version to use. Minimum required version is 293.0.0"
51+
type = string
52+
default = "294.0.0"
53+
}
54+
4355
variable "enable_gke_hub_registration" {
4456
description = "Enables GKE Hub Registration when set to true"
4557
type = bool

0 commit comments

Comments
 (0)