Skip to content

Commit 002cfb1

Browse files
feat: Add bool option for automount_service_account_token (#571)
Co-authored-by: Morgante Pell <morgantep@google.com>
1 parent d1c3c13 commit 002cfb1

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Diff for: modules/workload-identity/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ module "my-app-workload-identity" {
6868

6969
| Name | Description | Type | Default | Required |
7070
|------|-------------|:----:|:-----:|:-----:|
71+
| automount\_service\_account\_token | Enable automatic mounting of the service account token | bool | `"false"` | no |
7172
| cluster\_name | Cluster name. Required if using existing KSA. | string | `""` | no |
7273
| k8s\_sa\_name | Name for the existing Kubernetes service account | string | `"null"` | no |
7374
| location | Cluster location (region if regional cluster, zone if zonal cluster). Required if using existing KSA. | string | `""` | no |

Diff for: modules/workload-identity/main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ resource "google_service_account" "cluster_service_account" {
4747
resource "kubernetes_service_account" "main" {
4848
count = var.use_existing_k8s_sa ? 0 : 1
4949

50+
automount_service_account_token = var.automount_service_account_token
5051
metadata {
5152
name = var.name
5253
namespace = var.namespace

Diff for: modules/workload-identity/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,9 @@ variable "use_existing_k8s_sa" {
5353
default = false
5454
type = bool
5555
}
56+
57+
variable "automount_service_account_token" {
58+
description = "Enable automatic mounting of the service account token"
59+
default = false
60+
type = bool
61+
}

0 commit comments

Comments
 (0)