forked from pierront/but3-iac
mja
This commit is contained in:
@@ -31,3 +31,8 @@ module "compute" {
|
||||
backend_subnet_id = module.network.subnet_ids["backend"]
|
||||
database_subnet_id = module.network.subnet_ids["database"]
|
||||
}
|
||||
|
||||
module "iam" {
|
||||
source = "../../modules/iam"
|
||||
project_id = var.project_id
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
resource "google_service_account" "service_account" {
|
||||
account_id = "terraform"
|
||||
display_name = "service-account-terraform"
|
||||
}
|
||||
|
||||
resource "google_service_account_key" "mykey" {
|
||||
service_account_id = google_service_account.service_account.name
|
||||
public_key_type = "TYPE_X509_PEM_FILE"
|
||||
}
|
||||
|
||||
resource "google_project_iam_binding" "project" {
|
||||
project = var.project_id
|
||||
role = "roles/viewer"
|
||||
|
||||
members = [
|
||||
"serviceAccount:${google_service_account.service_account.email} ",
|
||||
]
|
||||
}
|
||||
|
||||
data "google_client_openid_userinfo" "me" {}
|
||||
|
||||
resource "google_os_login_ssh_public_key" "cache" {
|
||||
user = data.google_client_openid_userinfo.me.email
|
||||
key = file("~/.ssh/id_ed25519.pub")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user