Skip to content

Commit 5b16a50

Browse files
chore(docs): update Workload Identity README example for existing GSA (#1062)
Addresses #1059 -- without the `depends_on` block, the WI module will try to read a data source for a Google service account that has not yet been created. This is alluded to in the Workload Identity examples but not in the Workload Identity README. This commit updates the README to include the `depends_on` block. Co-authored-by: Morgante Pell <[email protected]>
1 parent 3dea235 commit 5b16a50

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

examples/workload_identity/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,6 @@ module "workload_identity_existing_gsa" {
9595
name = google_service_account.custom.account_id
9696
use_existing_gcp_sa = true
9797
# wait till custom GSA is created to force module data source read during apply
98+
# https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1059
9899
depends_on = [google_service_account.custom]
99100
}

modules/workload-identity/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ module "my-app-workload-identity" {
5959
use_existing_gcp_sa = true
6060
name = google_service_account.preexisting.account_id
6161
project_id = var.project_id
62+
63+
# wait for the custom GSA to be created to force module data source read during apply
64+
# https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/issues/1059
65+
depends_on = [google_service_account.preexisting]
6266
}
6367
```
6468

0 commit comments

Comments
 (0)