mirror of
https://github.com/ryboe/private-ip-cloud-sql-db.git
synced 2025-12-25 02:09:29 -05:00
16 lines
427 B
HCL
16 lines
427 B
HCL
// serviceaccount module
|
|
|
|
resource "google_service_account" "account" {
|
|
account_id = var.name
|
|
description = "The service account used by Cloud SQL Proxy to connect to the db"
|
|
}
|
|
|
|
resource "google_project_iam_member" "role" {
|
|
role = var.role
|
|
member = "serviceAccount:${google_service_account.account.email}"
|
|
}
|
|
|
|
resource "google_service_account_key" "key" {
|
|
service_account_id = google_service_account.account.name
|
|
}
|