Skip to content

Commit ee2073d

Browse files
Add bool option for automount_service_account_token
1 parent 796bd15 commit ee2073d

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

modules/workload-identity/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ module "my-app-workload-identity" {
7171

7272
| Name | Description | Type | Default | Required |
7373
|------|-------------|:----:|:-----:|:-----:|
74+
| automount\_service\_account\_token | Enable automatic mounting of the service account token | bool | `"false"` | no |
7475
| k8s\_sa\_name | Name for the existing Kubernetes service account | string | `"null"` | no |
7576
| name | Name for both service accounts | string | n/a | yes |
7677
| namespace | Namespace for k8s service account | string | `"default"` | no |

modules/workload-identity/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ resource "google_service_account" "cluster_service_account" {
3333
resource "kubernetes_service_account" "main" {
3434
count = var.use_existing_k8s_sa ? 0 : 1
3535

36+
automount_service_account_token = var.automount_service_account_token
3637
metadata {
3738
name = var.name
3839
namespace = var.namespace

modules/workload-identity/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ variable "use_existing_k8s_sa" {
4141
default = false
4242
type = bool
4343
}
44+
45+
variable "automount_service_account_token" {
46+
description = "Enable automatic mounting of the service account token"
47+
default = false
48+
type = bool
49+
}

0 commit comments

Comments
 (0)