Skip to content

Instantly share code, notes, and snippets.

@calum-github
Created May 20, 2021 04:02
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 calum-github/d3957456f3002be492ec4ab34e55f128 to your computer and use it in GitHub Desktop.
Save calum-github/d3957456f3002be492ec4ab34e55f128 to your computer and use it in GitHub Desktop.
# Create an instance
resource "google_compute_instance" "my-instance" {
project = var.project_id
name = "my-instance-01"
machine_type = "e2-standard-2"
zone = var.zone
boot_disk {
initialize_params {
image = "debian-cloud/debian-9"
}
}
network_interface {
network = "default"
}
service_account {
email = "<project-id>-compute@developer.gserviceaccount.com"
scopes = ["cloud-platform"]
}
metadata = {
enable-os-login = "true"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment