Open sashokbg opened 2 years ago
resource "google_compute_instance_template" "example" {
name_prefix = "example-"
project = "your-project-id"
region = "us-central1"
instance_description = "Example Instance Template"
tags = ["http-server", "https-server"]
disk {
source_image = "projects/ubuntu-os-cloud/global/images/family/ubuntu-2004-lts"
}
network_interface {
network = "global/networks/default"
}
service_account {
email = "your-service-account@your-project.iam.gserviceaccount.com"
scopes = ["https://www.googleapis.com/auth/cloud-platform"]
}
metadata = {
foo = "bar"
}
}
When creating a single instance we can attach an instance IAM policy to it with "google_compute_instance_iam_policy"
Ex:
The questions:
How do we attach instance iam policy to a dynamic instance that has been created via an instance template and an isntance group manager ?
Thank you for your help