github.com/darmach/terratest@v0.34.8-0.20210517103231-80931f95e3ff/examples/terraform-gcp-hello-world-example/main.tf (about) 1 terraform { 2 # This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting 3 # 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it 4 # forwards compatible with 0.13.x code. 5 required_version = ">= 0.12.26" 6 } 7 8 provider "google" { 9 region = "us-east1" 10 } 11 12 # website::tag::1:: Deploy a cloud instance 13 resource "google_compute_instance" "example" { 14 name = var.instance_name 15 machine_type = "f1-micro" 16 zone = "us-east1-b" 17 18 # website::tag::2:: Run Ubuntu 18.04 on the instace 19 boot_disk { 20 initialize_params { 21 image = "ubuntu-os-cloud/ubuntu-1804-lts" 22 } 23 } 24 25 network_interface { 26 network = "default" 27 access_config {} 28 } 29 } 30 31 # website::tag::3:: Allow the user to pass in a custom name for the instance 32 variable "instance_name" { 33 description = "The Name to use for the Cloud Instance." 34 default = "gcp-hello-world-example" 35 }