Create the google service account.
This commit is contained in:
parent
06b787ef97
commit
e17e2f24a7
@ -108,8 +108,9 @@ module "cloudsql" {
|
|||||||
# Create a workload identity service account for IAM authentication to
|
# Create a workload identity service account for IAM authentication to
|
||||||
# cloudsql
|
# cloudsql
|
||||||
module "cloudsql_test_sa" {
|
module "cloudsql_test_sa" {
|
||||||
source = "../modules/workload_identity_account"
|
source = "../modules/workload_identity_account"
|
||||||
project = var.project
|
project = var.project
|
||||||
|
k8s_service_account = "test-sa"
|
||||||
}
|
}
|
||||||
|
|
||||||
#################### Redis ################################
|
#################### Redis ################################
|
||||||
|
@ -6,3 +6,19 @@ variable "project" {
|
|||||||
description = "Project ID."
|
description = "Project ID."
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "k8s_namespace" {
|
||||||
|
description = "Name of the kubernetes namespace containing the service account."
|
||||||
|
type = string
|
||||||
|
default = "default"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "k8s_service_account" {
|
||||||
|
description = "Service account name from kubernetes."
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
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…
x
Reference in New Issue
Block a user