Skip to content

Commit

Permalink
feat: Add bool option for automount_service_account_token (#571)
Browse files Browse the repository at this point in the history
Co-authored-by: Morgante Pell <morgantep@google.com>
  • Loading branch information
davidholsgrove and morgante committed Jun 25, 2020
1 parent d1c3c13 commit 002cfb1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/workload-identity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ module "my-app-workload-identity" {

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| automount\_service\_account\_token | Enable automatic mounting of the service account token | bool | `"false"` | no |
| cluster\_name | Cluster name. Required if using existing KSA. | string | `""` | no |
| k8s\_sa\_name | Name for the existing Kubernetes service account | string | `"null"` | no |
| location | Cluster location (region if regional cluster, zone if zonal cluster). Required if using existing KSA. | string | `""` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/workload-identity/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ resource "google_service_account" "cluster_service_account" {
resource "kubernetes_service_account" "main" {
count = var.use_existing_k8s_sa ? 0 : 1

automount_service_account_token = var.automount_service_account_token
metadata {
name = var.name
namespace = var.namespace
Expand Down
6 changes: 6 additions & 0 deletions modules/workload-identity/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ variable "use_existing_k8s_sa" {
default = false
type = bool
}

variable "automount_service_account_token" {
description = "Enable automatic mounting of the service account token"
default = false
type = bool
}

0 comments on commit 002cfb1

Please sign in to comment.