Skip to content

Commit

Permalink
Add example of a Workload Identity Pool configuration for GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
b-r-o-c-k committed Oct 8, 2024
1 parent 1c7cde2 commit 9898e7f
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
resource "google_iam_workload_identity_pool" "pool" {
workload_identity_pool_id = "{{index $.Vars "workload_identity_pool_id"}}"
}

resource "google_iam_workload_identity_pool_provider" "{{$.PrimaryResourceId}}" {
workload_identity_pool_id = google_iam_workload_identity_pool.pool.workload_identity_pool_id
workload_identity_pool_provider_id = "{{index $.Vars "workload_identity_pool_provider_id"}}"
display_name = "Name of provider"
description = "GitHub Actions identity pool provider for automated test"
disabled = true
attribute_condition = <<EOT
assertion.repository_owner_id == "123456789" &&
attribute.repository == "gh-org/gh-repo" &&
assertion.ref == "refs/heads/main" &&
assertion.ref_type == "branch"
EOT
attribute_mapping = {
"google.subject" = "assertion.sub"
"attribute.actor" = "assertion.actor"
"attribute.aud" = "assertion.aud"
"attribute.repository" = "assertion.repository"
}
oidc {
issuer_uri = "https://token.actions.githubusercontent.com"
}
}

0 comments on commit 9898e7f

Please sign in to comment.