Skip to content

Commit

Permalink
Add new variable for iam service account name
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanvuong2021 committed Jan 25, 2024
1 parent d61b02d commit 91cb31a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/k8s/dev/reporting_v2_gke.cue
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ reporting: #Reporting & {
_internalApiTarget: certificateHost: "localhost"

_postgresConfig: {
iamUserLocal: "reporting-internal"
iamUserLocal: "reporting-v2-internal"
database: "reporting-v2"
}

_verboseGrpcServerLogging: true

serviceAccounts: {
"\(#InternalServerServiceAccount)": #WorkloadIdentityServiceAccount & {
_iamServiceAccountName: "reporting-internal"
_iamServiceAccountName: "reporting-v2-internal"
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/main/terraform/gcloud/cmms/reporting.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module "reporting_default_node_pool" {
module "reporting" {
source = "../modules/reporting"

postgres_instance = google_sql_database_instance.postgres
postgres_database_name = "reporting"
iam_service_account_name = "reporting-internal"
postgres_instance = google_sql_database_instance.postgres
postgres_database_name = "reporting"
}
5 changes: 3 additions & 2 deletions src/main/terraform/gcloud/cmms/reporting_v2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module "reporting_v2_default_node_pool" {
module "reporting_v2" {
source = "../modules/reporting"

postgres_instance = google_sql_database_instance.postgres
postgres_database_name = "reporting-v2"
iam_service_account_name = "reporting-v2-internal"
postgres_instance = google_sql_database_instance.postgres
postgres_database_name = "reporting-v2"
}
2 changes: 1 addition & 1 deletion src/main/terraform/gcloud/modules/reporting/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module "reporting_internal" {
source = "../workload-identity-user"

k8s_service_account_name = "internal-reporting-server"
iam_service_account_name = "reporting-internal"
iam_service_account_name = var.iam_service_account_name
iam_service_account_description = "Reporting internal API server."
}

Expand Down
6 changes: 6 additions & 0 deletions src/main/terraform/gcloud/modules/reporting/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ variable "postgres_database_name" {
nullable = false
}

variable "iam_service_account_name" {
description = "IAM `google_service_account.name`."
type = string
nullable = false
}

0 comments on commit 91cb31a

Please sign in to comment.