Terraform Basics: Understanding `init`, `plan`, and `apply`

Get Started
45 minutes
  • 3 Learning Objectives

About this Hands-on Lab

`init`, `plan`, and `apply` are the top three commands you will use when initializing, creating an execution plan, and executing the desired state of your configuration file. In this hands-on lab, we will learn how and when to use these three commands.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Create a Service Account

Create a service account named Terraform using the Google Cloud console and make sure to give it the Owner role.

Log in to the Host Instance and Ensure Terraform Is Installed

Using the provided virtual machine in our Google Cloud instance, make sure that we have our service account Terraform installed and that we can call it.

Create a Service Account Key within the Instance

In this objective, we need to:

  1. Use the virtual machine to create and set up the Service Account Key.
  2. Create the main.tf configuration file and then create and apply an execution plan.
  3. Use init, plan, and apply to finish our configuration.

Additional Resources

Your team has installed Terraform on an instance. They have tasked you with setting the keys and configuration to be able to use Terraform properly.

For this project, you must:

  1. Make sure the keys are set up to communicate with Terraform.
  2. Make sure the configuration files are initiated.
  3. Execute the config files to test your Terraform deployment.

Note: To make sure the lab is fully provisioned, please allow a few extra minutes before starting the lab. It is also important that the main.tf file has the correct project name and the service account identifier is set up correctly for authorization.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Get Started
Who’s going to be learning?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


$2,495.00

Checkout
Sign In
Welcome Back!
Thanks for reaching out!

You’ll hear from us shortly. In the meantime, why not check out what our customers have to say about ACG?