Terraform snippets

    This code creates a Google Compute Instance (GCE) with the name "example-name" and the description "example-description". The GCE will be created with the machine type "n1-standard-1", and will be configured with a 2TB disk in the "debian-cloud/debian-8" source image. The GCE will be booted with the "auto_delete" setting set to true, so that it will be automatically deleted after 6 months.

    Shortcut: tf_google_compute_instance_template

    resource "google_compute_instance_template" "${MyResource}" {
       name = "example-name"
       description = "example-description"
       machine_type = "n1-standard-1"
       disk {
           source_image = "debian-cloud/debian-8"
           auto_delete = true
           boot = true
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.