learn-terraform

Course outlines for learning terraform.

View the Project on GitHub robertdebock/learn-terraform

Change infrastructure

expected time requirements
15 minutes A computer with Terraform installed.

Goal Learn how to change infrastructure.

Explanation

In the previous lab you were able to connect (and create a resource) on the cloud provider. Let’s modify your code a bit and understand how Terraform reacts. You’ll add a few tags to the azurerm_resouce_group.

Howto

Follow the steps described below.

Demo

Assignment

View the results

AWS Console Azure Portal GCP Console

Questions:

  1. Can I still change stuff (resources) manually on the providers console?
  2. If I lost the state file, can I simply re-apply the same Terraform code?
  3. If I change the name of an instance, will the instance be recreated or renamed?
  4. Why would you append -out=planfile to terraform plan?

Solution

It’s described in this section: