{"id":30066,"date":"2026-12-05T22:05:14","date_gmt":"2026-12-05T22:05:14","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=30066"},"modified":"2026-12-05T22:05:14","modified_gmt":"2026-12-05T22:05:14","slug":"terraform-tutorial-with-google-cloud-create-single-vm","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/terraform-tutorial-with-google-cloud-create-single-vm\/","title":{"rendered":"Terraform Tutorial with Google Cloud &#8211; Create Single VM"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This tutorial shows how to create a single Google Compute Engine VM with Terraform, using the <code>google_compute_instance<\/code> resource above as the starting point. The snippet above only shows the resource block. It leaves out the provider configuration, project and zone settings, and authentication, and it uses a Debian 9 image that Google has since retired. The sections below give a complete working configuration, the commands to deploy it and remove it, and fixes for the errors people hit most often.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">resource <span class=\"hljs-string\">\"google_compute_instance\"<\/span> <span class=\"hljs-string\">\"vm_instance\"<\/span> {\r\n  name         = <span class=\"hljs-string\">\"terraform-instance\"<\/span>\r\n  machine_type = <span class=\"hljs-string\">\"e2-micro\"<\/span>\r\n\r\n  boot_disk {\r\n    initialize_params {\r\n      image = <span class=\"hljs-string\">\"debian-cloud\/debian-9\"<\/span>\r\n    }\r\n  }\r\n\r\n  network_interface {\r\n    <span class=\"hljs-comment\"># A default network is created for all GCP projects<\/span>\r\n    network = <span class=\"hljs-string\">\"default\"<\/span>\r\n    access_config {\r\n    }\r\n  }\r\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">What the example above does and what it is missing<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The resource block declares one VM named <code>terraform-instance<\/code> with the <code>e2-micro<\/code> machine type. Its boot disk is built from a public Debian image, and its network interface is attached to the project&#039;s <code>default<\/code> VPC. The empty <code>access_config {}<\/code> block matters: it tells Google to give the VM an ephemeral external IP address. If you remove it, the VM gets only an internal IP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Terraform cannot run that block on its own. To work, it also needs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <code>terraform<\/code> block that declares the <code>hashicorp\/google<\/code> provider.<\/li>\n\n\n<li>A <code>provider &quot;google&quot;<\/code> block that sets the <strong>project<\/strong>, <strong>region<\/strong> and <strong>zone<\/strong>. Without a zone, the instance cannot be placed.<\/li>\n\n\n<li>Credentials Terraform can use to call the Google Cloud APIs.<\/li>\n\n\n<li>An image that still exists. The <code>debian-cloud\/debian-9<\/code> image family has been deprecated and removed from the public image list.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A Google Cloud project with billing enabled.<\/li>\n\n\n<li>Terraform 1.5 or later installed (<code>terraform version<\/code>).<\/li>\n\n\n<li>The Google Cloud CLI installed (<code>gcloud version<\/code>).<\/li>\n\n\n<li>An account with permission to create Compute Engine instances in the project, for example the Compute Instance Admin role.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Sign in, select the project, enable the Compute Engine API and create Application Default Credentials (ADC). The Terraform provider picks up ADC automatically, so you do not need a key file.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">gcloud<\/span> <span class=\"hljs-selector-tag\">auth<\/span> <span class=\"hljs-selector-tag\">login<\/span>\n<span class=\"hljs-selector-tag\">gcloud<\/span> <span class=\"hljs-selector-tag\">config<\/span> <span class=\"hljs-selector-tag\">set<\/span> <span class=\"hljs-selector-tag\">project<\/span> <span class=\"hljs-selector-tag\">YOUR_PROJECT_ID<\/span>\n<span class=\"hljs-selector-tag\">gcloud<\/span> <span class=\"hljs-selector-tag\">services<\/span> <span class=\"hljs-selector-tag\">enable<\/span> <span class=\"hljs-selector-tag\">compute<\/span><span class=\"hljs-selector-class\">.googleapis<\/span><span class=\"hljs-selector-class\">.com<\/span>\n<span class=\"hljs-selector-tag\">gcloud<\/span> <span class=\"hljs-selector-tag\">auth<\/span> <span class=\"hljs-selector-tag\">application-default<\/span> <span class=\"hljs-selector-tag\">login<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Don&#039;t download service account JSON keys to a laptop just to run Terraform. Use ADC locally. In CI, use Workload Identity Federation or an attached service account.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Complete working configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Create an empty directory and add the following files. Together they wrap the original resource in everything it needs to run.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># versions.tf<\/span>\nterraform {\n  required_version = <span class=\"hljs-string\">\"&gt;= 1.5\"<\/span>\n\n  required_providers {\n    google = {\n      source  = <span class=\"hljs-string\">\"hashicorp\/google\"<\/span>\n      version = <span class=\"hljs-string\">\"&gt;= 6.0\"<\/span>\n    }\n  }\n}\n\nprovider <span class=\"hljs-string\">\"google\"<\/span> {\n  project = <span class=\"hljs-keyword\">var<\/span>.project_id\n  region  = <span class=\"hljs-keyword\">var<\/span>.region\n  zone    = <span class=\"hljs-keyword\">var<\/span>.zone\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># variables.tf<\/span>\nvariable <span class=\"hljs-string\">\"project_id\"<\/span> {\n  description = <span class=\"hljs-string\">\"Google Cloud project ID\"<\/span>\n  type        = string\n}\n\nvariable <span class=\"hljs-string\">\"region\"<\/span> {\n  type    = string\n  <span class=\"hljs-keyword\">default<\/span> = <span class=\"hljs-string\">\"us-central1\"<\/span>\n}\n\nvariable <span class=\"hljs-string\">\"zone\"<\/span> {\n  type    = string\n  <span class=\"hljs-keyword\">default<\/span> = <span class=\"hljs-string\">\"us-central1-a\"<\/span>\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># main.tf<\/span>\nresource <span class=\"hljs-string\">\"google_compute_instance\"<\/span> <span class=\"hljs-string\">\"vm_instance\"<\/span> {\n  name         = <span class=\"hljs-string\">\"terraform-instance\"<\/span>\n  machine_type = <span class=\"hljs-string\">\"e2-micro\"<\/span>\n  zone         = <span class=\"hljs-keyword\">var<\/span>.zone\n\n  labels = {\n    env        = <span class=\"hljs-string\">\"lab\"<\/span>\n    managed_by = <span class=\"hljs-string\">\"terraform\"<\/span>\n  }\n\n  boot_disk {\n    initialize_params {\n      image = <span class=\"hljs-string\">\"debian-cloud\/debian-12\"<\/span>\n      size  = <span class=\"hljs-number\">10<\/span>\n    }\n  }\n\n  network_interface {\n    network = <span class=\"hljs-string\">\"default\"<\/span>\n    access_config {}   <span class=\"hljs-comment\"># ephemeral public IP<\/span>\n  }\n\n  shielded_instance_config {\n    enable_secure_boot = <span class=\"hljs-keyword\">true<\/span>\n  }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># outputs.tf<\/span>\noutput <span class=\"hljs-string\">\"instance_name\"<\/span> {\n  value = google_compute_instance.vm_instance.name\n}\n\noutput <span class=\"hljs-string\">\"external_ip\"<\/span> {\n  value = google_compute_instance.vm_instance.network_interface&#91;<span class=\"hljs-number\">0<\/span>].access_config&#91;<span class=\"hljs-number\">0<\/span>].nat_ip\n}\n\noutput <span class=\"hljs-string\">\"internal_ip\"<\/span> {\n  value = google_compute_instance.vm_instance.network_interface&#91;<span class=\"hljs-number\">0<\/span>].network_ip\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># terraform.tfvars<\/span>\nproject_id = <span class=\"hljs-string\">\"YOUR_PROJECT_ID\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><code>debian-cloud\/debian-12<\/code> uses the <code>project\/family<\/code> shorthand, which always resolves to the latest image in that family. If you need builds you can repeat exactly, pin a specific image name instead. To list the current families, run <code>gcloud compute images list --filter=&quot;family~debian&quot;<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Before using this in a real project, check the Terraform Registry for the latest major version of the Google provider. Then pin to it with a pessimistic constraint such as <code>~&gt; X.0<\/code>, so that a future major release cannot change behaviour without warning.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Deploy, connect and clean up<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Run <code>terraform init<\/code> to download the Google provider and create <code>.terraform.lock.hcl<\/code>.<\/li>\n\n\n<li>Run <code>terraform fmt<\/code> and <code>terraform validate<\/code> to catch syntax mistakes early.<\/li>\n\n\n<li>Run <code>terraform plan<\/code> and review it. It should end with <code>Plan: 1 to add, 0 to change, 0 to destroy.<\/code><\/li>\n\n\n<li>Run <code>terraform apply<\/code> and type <code>yes<\/code>. Creating the VM usually takes under a minute, and the outputs print at the end.<\/li>\n\n\n<li>Connect with <code>gcloud compute ssh terraform-instance --zone us-central1-a<\/code>. The default network includes a firewall rule that allows SSH on port 22.<\/li>\n\n\n<li>When you have finished, run <code>terraform destroy<\/code> so you are not billed for the VM or its disk.<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">$ terraform apply\n...\ngoogle_compute_instance.vm_instance: Creating...\ngoogle_compute_instance.vm_instance: Creation complete after <span class=\"hljs-number\">15<\/span>s &#91;id=projects\/YOUR_PROJECT_ID\/zones\/us-central1-a\/instances\/terraform-instance]\n\nApply complete! Resources: <span class=\"hljs-number\">1<\/span> added, <span class=\"hljs-number\">0<\/span> changed, <span class=\"hljs-number\">0<\/span> destroyed.\n\nOutputs:\n\nexternal_ip = <span class=\"hljs-string\">\"34.x.x.x\"<\/span>\ninstance_name = <span class=\"hljs-string\">\"terraform-instance\"<\/span>\ninternal_ip = <span class=\"hljs-string\">\"10.128.0.2\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Corrected version of the original snippet<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you only want to fix the snippet above, here is the minimal corrected resource. You still need the provider block from the previous section.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">resource <span class=\"hljs-string\">\"google_compute_instance\"<\/span> <span class=\"hljs-string\">\"vm_instance\"<\/span> {\n  name         = <span class=\"hljs-string\">\"terraform-instance\"<\/span>\n  machine_type = <span class=\"hljs-string\">\"e2-micro\"<\/span>\n  zone         = <span class=\"hljs-string\">\"us-central1-a\"<\/span>\n\n  boot_disk {\n    initialize_params {\n      image = <span class=\"hljs-string\">\"debian-cloud\/debian-12\"<\/span>\n    }\n  }\n\n  network_interface {\n    network = <span class=\"hljs-string\">\"default\"<\/span>\n    access_config {}\n  }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<ul class=\"wp-block-list\">\n<li><code>debian-cloud\/debian-9<\/code> became <code>debian-cloud\/debian-12<\/code>, because the Debian 9 image family is retired and no longer resolves.<\/li>\n\n\n<li>Added a <code>zone<\/code>. Alternatively, set it in the provider block, as shown in the full configuration.<\/li>\n\n\n<li>A provider block with a <code>project<\/code> is required, or you can set the <code>GOOGLE_PROJECT<\/code> environment variable instead.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Common errors and fixes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Error message (abbreviated)<\/th><th>Cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td><code>could not find default credentials<\/code><\/td><td>ADC is not configured<\/td><td>Run <code>gcloud auth application-default login<\/code><\/td><\/tr><tr><td><code>project: required field is not set<\/code><\/td><td>No project in the provider block or the environment<\/td><td>Set <code>project<\/code> in the provider block or export <code>GOOGLE_PROJECT<\/code><\/td><\/tr><tr><td><code>Compute Engine API has not been used in project ... or it is disabled<\/code><\/td><td>The API is not enabled<\/td><td>Run <code>gcloud services enable compute.googleapis.com<\/code> and wait a minute<\/td><\/tr><tr><td><code>The resource &#039;projects\/debian-cloud\/global\/images\/family\/debian-9&#039; was not found<\/code><\/td><td>The image family is retired<\/td><td>Use <code>debian-cloud\/debian-12<\/code> or another current family<\/td><\/tr><tr><td><code>The resource &#039;projects\/...\/networks\/default&#039; was not found<\/code><\/td><td>The project has no default VPC, which is common when an organization policy skips its creation<\/td><td>Create a VPC with <code>google_compute_network<\/code> or reference an existing one<\/td><\/tr><tr><td><code>ZONE_RESOURCE_POOL_EXHAUSTED<\/code> or a quota error<\/td><td>The zone is out of capacity or a project quota has been reached<\/td><td>Try another zone or request a quota increase<\/td><\/tr><tr><td><code>Required &#039;compute.instances.create&#039; permission<\/code><\/td><td>Your identity lacks IAM permissions<\/td><td>Grant a role such as Compute Instance Admin on the project<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Best practices and security notes<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Do not commit state.<\/strong> Add <code>*.tfstate*<\/code>, <code>.terraform\/<\/code> and <code>*.tfvars<\/code> files that contain secrets to <code>.gitignore<\/code>. Do commit <code>.terraform.lock.hcl<\/code>.<\/li>\n\n\n<li><strong>Use remote state for team work.<\/strong> Configure a <code>backend &quot;gcs&quot;<\/code> block pointing at a versioned Cloud Storage bucket, so state is shared and protected by locking.<\/li>\n\n\n<li><strong>Limit public exposure.<\/strong> Drop <code>access_config {}<\/code> when a VM doesn&#039;t need a public IP. Use IAP TCP forwarding (<code>gcloud compute ssh --tunnel-through-iap<\/code>) or Cloud NAT for outbound traffic.<\/li>\n\n\n<li><strong>Attach a dedicated service account<\/strong> to the VM with only the roles it needs, rather than relying on the Compute Engine default service account.<\/li>\n\n\n<li><strong>Turn on deletion protection<\/strong> (<code>deletion_protection = true<\/code>) for long-lived VMs.<\/li>\n\n\n<li><strong>Scan and lint before applying.<\/strong> Tools such as tfsec flag issues like public IPs and missing Shielded VM settings. See <a href=\"https:\/\/www.devopsschool.com\/blog\/terraform-tutorials-tfsec-for-security-scanning\/\">Terraform Tutorials: TFSec for Security Scanning<\/a> and <a href=\"https:\/\/www.devopsschool.com\/blog\/how-to-configure-pre-commit-for-terraform-complete-devops-guide-with-15-practical-use-cases-commands-security-checks-and-best-practices\/\">How to Configure pre-commit for Terraform<\/a>.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">To create several identical VMs from one block, add <code>count<\/code> or <code>for_each<\/code> to the resource. <a href=\"https:\/\/www.devopsschool.com\/blog\/how-to-do-looping-iterations-in-terraform\/\">Terraform Loops and Iteration<\/a> covers both patterns.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Why does Terraform say the debian-9 image was not found?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Google has retired the Debian 9 image family, so <code>debian-cloud\/debian-9<\/code> no longer resolves to an image. Change it to a current family such as <code>debian-cloud\/debian-12<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Do I need a service account key file to run Terraform against Google Cloud?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. Locally, run <code>gcloud auth application-default login<\/code> and the Google provider uses those credentials automatically. In CI, Workload Identity Federation is preferred over long-lived JSON keys.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What does the empty access_config block do?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It gives the VM an ephemeral external IP address. If you remove it, the instance has only an internal IP and needs IAP, a bastion host or Cloud NAT for access and outbound traffic.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is an e2-micro VM free?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Google Cloud&#039;s Always Free tier includes one e2-micro instance per month in certain US regions, subject to the current free tier terms. VMs outside those regions, or above the free limits, are billed normally, so run <code>terraform destroy<\/code> when you have finished testing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I get the VM&#039;s public IP from Terraform?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Add an output that references <code>google_compute_instance.vm_instance.network_interface[0].access_config[0].nat_ip<\/code>, then run <code>terraform output external_ip<\/code> after apply.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related tutorials<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/infrastructure-as-code\/terraform\/\">More Terraform tutorials<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/cloud-computing\/google-cloud\/\">More Google Cloud tutorials<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/terraform-tutorials-tfsec-for-security-scanning\/\">Terraform Tutorials: TFSec for Security Scanning<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/how-to-do-looping-iterations-in-terraform\/\">Terraform Loops and Iteration: Complete Guide to count, for_each, for Expressions, and Dynamic Blocks<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to create a single Google Compute Engine VM with Terraform, using the google_compute_instance resource above as the starting point. The snippet above only&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5129,26149],"tags":[26259,26224],"class_list":["post-30066","post","type-post","status-publish","format-standard","hentry","category-terraform","category-google-cloud","tag-google-compute-engine","tag-hcl"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=30066"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30066\/revisions"}],"predecessor-version":[{"id":80675,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/30066\/revisions\/80675"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=30066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=30066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=30066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}