Skip to content

Commit

Permalink
fixed tmp service account issue
Browse files Browse the repository at this point in the history
  • Loading branch information
amanpruthi committed Jun 6, 2024
1 parent 521da67 commit 5f7cf05
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module "app_gke" {
network = local.network
subnetwork = local.subnetwork
service_account = module.service_accounts.service_account
create_workload_identity = var.enable_stackdriver
create_workload_identity = var.create_workload_identity
depends_on = [module.project_factory_project_services]
}

Expand Down Expand Up @@ -255,9 +255,9 @@ module "wandb" {
}
serviceAccount = { annotations = { "iam.gke.io/gcp-service-account" = module.service_accounts.monitoring_role } }
} : {
install = false
stackdriver = {}
serviceAccount = {}
install = false
stackdriver = {}
serviceAccount = {}
}

otel = {
Expand Down
3 changes: 1 addition & 2 deletions modules/service_accounts/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@ 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 = local.sa_member
}


resource "google_project_iam_member" "workload_identity-role" {
count = var.enable_stackdriver == true ? 1 : 0
project = local.project_id
Expand Down
8 changes: 7 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ variable "parquet_wandb_env" {

variable "enable_stackdriver" {
type = bool
default = false
default = true
}

variable "workload_account_id" {
Expand All @@ -267,4 +267,10 @@ variable "workload_account_id" {
variable "service_account_name" {
type = string
default = "stackdriver"
}

variable "create_workload_identity" {
description = "Flag to indicate whether to create a workload identity for the service account."
type = bool
default = true
}

0 comments on commit 5f7cf05

Please sign in to comment.