Using Terraform Cloud Remote State Management – a quick introduction

Some days ago Hashicorp announced the availability of the free-to-use collaboration features in the Terraform cloud. This allows individuals and teams to easily store state information in the cloud and make it accessible from anywhere.

First you need create your account. Then, you can create a new organization.

image

Now create either a personal or a team token to get access to your organization. For this example I created a team token.

image

Now create your Terraform config file and configure it to use the Terraform cloud backend. To keep things simple, I added the token directly into the configuration file (which is not a very good practice of course).

image

  • Hostname > app.terraform.io
  • Organization > Your organization name in the Terraform cloud
  • Workspace > Your workspace name (will be created automatically)
  • Token > The created token for authentication

Save the file and start the Terraform process using ‘init’, ‘plan’ and ‘apply’ as normal. Once completed, the state information is available in the Terraform cloud. The local box does not store details about the state other than the information where the remote state is stored.

image

image

As the post title mentions, that’s it for the quick introduction. I will probably post some more stuff around this soon.

Cheers
Marcel

About Marcel Zehner

Microsoft Azure MVP
This entry was posted in Azure, DevOps and tagged , , , , , , , . Bookmark the permalink.

1 Response to Using Terraform Cloud Remote State Management – a quick introduction

  1. Pingback: Using the Terraform Cloud with multiple Workspaces | marcelzehner.ch

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s