Skip to content

Commit

Permalink
add getAccessToken
Browse files Browse the repository at this point in the history
  • Loading branch information
GondekNP committed Dec 31, 2023
1 parent ad60173 commit 7ae0032
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
6 changes: 6 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ resource "google_project_iam_member" "cloudbuild_builder" {
member = "serviceAccount:${google_service_account.default.email}"
}

resource "google_project_iam_member" "SA_get_access_token" {
project = "dse-nps"
role = "roles/iam.serviceAccountUser"
member = "serviceAccount:${google_service_account.default.email}"
}

resource "google_service_account_iam_binding" "workload_identity_user" {
service_account_id = google_service_account.default.name
role = "roles/iam.workloadIdentityUser"
Expand Down
26 changes: 25 additions & 1 deletion terraform.tfstate
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 4,
"terraform_version": "1.6.0",
"serial": 62,
"serial": 64,
"lineage": "44075ebe-b91a-1e72-3b17-affdfb63c0f1",
"outputs": {},
"resources": [
Expand Down Expand Up @@ -313,6 +313,30 @@
}
]
},
{
"mode": "managed",
"type": "google_project_iam_member",
"name": "SA_getAccessToken",
"provider": "provider[\"registry.opentofu.org/hashicorp/google\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"condition": [],
"etag": "BwYNxR9UGJw=",
"id": "dse-nps/roles/iam.serviceAccountUser/serviceAccount:[email protected]",
"member": "serviceAccount:[email protected]",
"project": "dse-nps",
"role": "roles/iam.serviceAccountUser"
},
"sensitive_attributes": [],
"private": "bnVsbA==",
"dependencies": [
"google_service_account.default"
]
}
]
},
{
"mode": "managed",
"type": "google_project_iam_member",
Expand Down
6 changes: 2 additions & 4 deletions terraform.tfstate.backup
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 4,
"terraform_version": "1.6.0",
"serial": 60,
"serial": 62,
"lineage": "44075ebe-b91a-1e72-3b17-affdfb63c0f1",
"outputs": {},
"resources": [
Expand Down Expand Up @@ -294,9 +294,7 @@
"name": "projects/113009620257/locations/global/workloadIdentityPools/github/providers/oidc-provider",
"oidc": [
{
"allowed_audiences": [
"https://github.com/SchmidtDSE"
],
"allowed_audiences": [],
"issuer_uri": "https://token.actions.githubusercontent.com",
"jwks_json": ""
}
Expand Down

0 comments on commit 7ae0032

Please sign in to comment.