Skip to content

Instantly share code, notes, and snippets.

@magickatt
Last active June 12, 2020 03:26
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 magickatt/4529c25063c3a71750c321fd61cc5fda to your computer and use it in GitHub Desktop.
Save magickatt/4529c25063c3a71750c321fd61cc5fda to your computer and use it in GitHub Desktop.
locals {
project_ids = [123456789012, 234567890123, 345678901234]
}
# Allow every other project access to GCE VM images in a central project
resource "google_project_iam_member" "image_user" {
for_each = local.project_ids
project = "tools-275721"
role = "roles/compute.imageUser"
member = "serviceAccount:${each.value}@cloudservices.gserviceaccount.com"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment