hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.29k stars 1.72k forks source link

Container image option in google_compute_instance_template #4193

Open JasperWoo opened 5 years ago

JasperWoo commented 5 years ago

Community Note

Description

We can simplify application deployment by deploying containers to instances in managed instance groups. This is supported in GCP as here.

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_compute_instance_template" "default" {
...
  // New option: Deploy container from Google Container Registry
  container {
    source_image = "http://us.gcr.io/path_to_image:latest"
  }
  // Create a new boot disk from an image
  disk {
    source_image = "debian-cloud/debian-9"
    auto_delete  = true
    boot         = true
  }
...
}

References

  1. https://cloud.google.com/compute/docs/containers/deploying-containers#managedinstancegroupcontainer
  2. https://www.terraform.io/docs/providers/google/r/compute_instance_template.html