Add a cloudsql username output from the workload identity module.

master
Tom Alexander 3 years ago
parent 5945ad86a8
commit 78b497783b
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

@ -23,6 +23,11 @@ output "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" {
account_id = "wi-${var.k8s_namespace}-${var.k8s_service_account}"
display_name = "Workload identity account for GKE [${var.k8s_namespace}/${var.k8s_service_account}]"

Loading…
Cancel
Save