Add a cloudsql username output from the workload identity module.
This commit is contained in:
parent
5945ad86a8
commit
78b497783b
@ -23,6 +23,11 @@ output "service_account" {
|
|||||||
value = google_service_account.service_account
|
value = google_service_account.service_account
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output "cloudsql_username" {
|
||||||
|
description = "If this service account is to be used with IAM database authentication, this would be the username for the user. Note that the google_sql_user is not created by this module."
|
||||||
|
value = trimsuffix(google_service_account.service_account.email, ".gserviceaccount.com")
|
||||||
|
}
|
||||||
|
|
||||||
resource "google_service_account" "service_account" {
|
resource "google_service_account" "service_account" {
|
||||||
account_id = "wi-${var.k8s_namespace}-${var.k8s_service_account}"
|
account_id = "wi-${var.k8s_namespace}-${var.k8s_service_account}"
|
||||||
display_name = "Workload identity account for GKE [${var.k8s_namespace}/${var.k8s_service_account}]"
|
display_name = "Workload identity account for GKE [${var.k8s_namespace}/${var.k8s_service_account}]"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user