Skip to content

Commit 182dded

Browse files
feat: Expose service account variable on ASM submodule (#658)
1 parent b9493d5 commit 182dded

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

modules/asm/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ To deploy this config:
5151
| internal\_ip | Use internal ip for the cluster endpoint. | bool | `"false"` | no |
5252
| location | The location (zone or region) this cluster has been created in. | string | n/a | yes |
5353
| project\_id | The project in which the resource belongs. | string | n/a | yes |
54+
| service\_account\_key\_file | Path to service account key file to auth as for running `gcloud container clusters get-credentials`. | string | `""` | no |
5455
| skip\_gcloud\_download | Whether to skip downloading gcloud (assumes gcloud and kubectl already available outside the module) | bool | `"true"` | no |
5556

5657
## Outputs

modules/asm/main.tf

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ module "asm_install" {
1919
version = "~> 2.0.2"
2020
module_depends_on = [var.cluster_endpoint]
2121

22-
gcloud_sdk_version = var.gcloud_sdk_version
23-
skip_download = var.skip_gcloud_download
24-
upgrade = true
25-
additional_components = ["kubectl", "kpt", "beta", "kustomize"]
26-
cluster_name = var.cluster_name
27-
cluster_location = var.location
28-
project_id = var.project_id
22+
gcloud_sdk_version = var.gcloud_sdk_version
23+
skip_download = var.skip_gcloud_download
24+
upgrade = true
25+
additional_components = ["kubectl", "kpt", "beta", "kustomize"]
26+
cluster_name = var.cluster_name
27+
cluster_location = var.location
28+
project_id = var.project_id
29+
service_account_key_file = var.service_account_key_file
2930

3031

3132
kubectl_create_command = "${path.module}/scripts/install_asm.sh ${var.project_id} ${var.cluster_name} ${var.location} ${var.asm_dir} ${var.asm_version}"

modules/asm/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,9 @@ variable "asm_version" {
8181
type = string
8282
default = "release-1.6-asm"
8383
}
84+
85+
variable "service_account_key_file" {
86+
description = "Path to service account key file to auth as for running `gcloud container clusters get-credentials`."
87+
default = ""
88+
}
89+

0 commit comments

Comments
 (0)