Skip to content

Instantly share code, notes, and snippets.

@bechampion
Created June 12, 2019 08:28
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 bechampion/427b163539a14874a1ca75a2c20ffe40 to your computer and use it in GitHub Desktop.
Save bechampion/427b163539a14874a1ca75a2c20ffe40 to your computer and use it in GitHub Desktop.
resource "google_compute_instance" "publicinstances" {
count = length(local.mappublicinstances)
project = var.serviceprojectid
dynamic "service_account"{
for_each = local.mappublicinstances[count.index]["sa"] == true ? [true] : []
content {
scopes = ["https://www.googleapis.com/auth/bigquery","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/source.full_control","https://www.googleapis.com/auth/source.read_only","https://www.googleapis.com/auth/compute.readonly","https://www.googleapis.com/auth/compute","https://www.googleapis.com/auth/datastore","https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/monitoring.write","https://www.googleapis.com/auth/pubsub","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/sqlservice.admin","https://www.googleapis.com/auth/devstorage.full_control","https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/devstorage.read_write","https://www.googleapis.com/auth/taskqueue","https://www.googleapis.com/auth/trace.append","https://www.googleapis.com/auth/userinfo.email"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment