Skip to content

Commit

Permalink
Merge branch 'main' into aman/tshirt-size
Browse files Browse the repository at this point in the history
  • Loading branch information
amanpruthi committed Jun 10, 2024
2 parents 0c53c4d + 9c6a775 commit 38a2439
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file.

## [3.2.0](https://github.com/wandb/terraform-google-wandb/compare/v3.1.1...v3.2.0) (2024-06-07)


### Features

* Track the otel and stackdriver sa issue ([#134](https://github.com/wandb/terraform-google-wandb/issues/134)) ([08abe84](https://github.com/wandb/terraform-google-wandb/commit/08abe848938ba80d48c2e747b5e9f229dd01eda4))

### [3.1.1](https://github.com/wandb/terraform-google-wandb/compare/v3.1.0...v3.1.1) (2024-06-05)


Expand Down
13 changes: 9 additions & 4 deletions modules/service_accounts/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,25 @@ resource "google_service_account" "workload-identity-user-sa" {
count = var.enable_stackdriver == true ? 1 : 0
account_id = "stackdriver"
display_name = "Service Account For Workload Identity"

}

resource "google_project_iam_member" "monitoring-role" {
count = var.enable_stackdriver == true ? 1 : 0
project = local.project_id
role = "roles/monitoring.viewer"
member = "serviceAccount:${google_service_account.workload-identity-user-sa[count.index].email}"
member = "serviceAccount:${google_service_account.workload-identity-user-sa[count.index].email}"
}

resource "google_service_account_iam_member" "monitoring-role" {
count = var.enable_stackdriver == true ? 1 : 0
service_account_id = google_service_account.workload-identity-user-sa[count.index].id
role = "roles/iam.serviceAccountTokenCreator"
member = "serviceAccount:${google_service_account.workload-identity-user-sa[count.index].email}"
}

resource "google_project_iam_member" "workload_identity-role" {
resource "google_service_account_iam_member" "workload_identity-role" {
count = var.enable_stackdriver == true ? 1 : 0
project = local.project_id
service_account_id = google_service_account.workload-identity-user-sa[count.index].id
role = "roles/iam.workloadIdentityUser"
member = "serviceAccount:${local.project_id}.svc.id.goog[default/${var.service_account_name}]"
}

0 comments on commit 38a2439

Please sign in to comment.