Skip to content

Instantly share code, notes, and snippets.

@calum-github
Created May 20, 2021 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calum-github/a0b90815ef53f1b509a64976e7248014 to your computer and use it in GitHub Desktop.
Save calum-github/a0b90815ef53f1b509a64976e7248014 to your computer and use it in GitHub Desktop.
# Define the required roles to access the VM
locals {
compute_roles = [
"roles/compute.viewer",
"roles/compute.osLogin",
]
}
# Apply the roles to a user account
resource "google_project_iam_member" "assign-roles" {
count = length(local.compute_roles)
project = var.project_id
role = local.roles[count.index]
member = "user:calum.hunter@the.cloud"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment