Skip to content

Commit

Permalink
feat: Expose service account variable on ASM submodule (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-pharaoh committed Sep 10, 2020
1 parent b9493d5 commit 182dded
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions modules/asm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ To deploy this config:
| internal\_ip | Use internal ip for the cluster endpoint. | bool | `"false"` | no |
| location | The location (zone or region) this cluster has been created in. | string | n/a | yes |
| project\_id | The project in which the resource belongs. | string | n/a | yes |
| service\_account\_key\_file | Path to service account key file to auth as for running `gcloud container clusters get-credentials`. | string | `""` | no |
| skip\_gcloud\_download | Whether to skip downloading gcloud (assumes gcloud and kubectl already available outside the module) | bool | `"true"` | no |

## Outputs
Expand Down
15 changes: 8 additions & 7 deletions modules/asm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ module "asm_install" {
version = "~> 2.0.2"
module_depends_on = [var.cluster_endpoint]

gcloud_sdk_version = var.gcloud_sdk_version
skip_download = var.skip_gcloud_download
upgrade = true
additional_components = ["kubectl", "kpt", "beta", "kustomize"]
cluster_name = var.cluster_name
cluster_location = var.location
project_id = var.project_id
gcloud_sdk_version = var.gcloud_sdk_version
skip_download = var.skip_gcloud_download
upgrade = true
additional_components = ["kubectl", "kpt", "beta", "kustomize"]
cluster_name = var.cluster_name
cluster_location = var.location
project_id = var.project_id
service_account_key_file = var.service_account_key_file


kubectl_create_command = "${path.module}/scripts/install_asm.sh ${var.project_id} ${var.cluster_name} ${var.location} ${var.asm_dir} ${var.asm_version}"
Expand Down
6 changes: 6 additions & 0 deletions modules/asm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,9 @@ variable "asm_version" {
type = string
default = "release-1.6-asm"
}

variable "service_account_key_file" {
description = "Path to service account key file to auth as for running `gcloud container clusters get-credentials`."
default = ""
}

0 comments on commit 182dded

Please sign in to comment.