Files
private-ip-cloud-sql-db/modules/serviceaccount/main.tf
Ryan Boehning f7ef3d241a Initial commit
2020-04-19 03:40:44 -07:00

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
}