This commit is contained in:
2025-12-04 11:02:25 +01:00
parent 68790cf2d1
commit 4530087cd1
5 changed files with 80 additions and 9 deletions

View File

@@ -0,0 +1,31 @@
resource "google_service_account" "myaccount" {
account_id = "terraform"
display_name = "terraform"
}
resource "google_service_account_key" "mykey" {
service_account_id = google_service_account.myaccount.name
public_key_type = "TYPE_X509_PEM_FILE"
}
resource "google_project_iam_binding" "project_iam" {
project = var.project_id
role = "roles/view"
members = [
"serviceAccount:${google_service_account.myaccount.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")
}

View File

@@ -0,0 +1,5 @@
variable "project_id" {
description = "Le projet ID"
type = string
}