Set Up the Environment
-
In the terminal, once logged into your instance, git clone https://github.com/acc-tf-training/tf-cloud-cli
-
Apply the Terraform configuration.
-
In the AWS Console, navigate to the IAM user and generate your Access key ID and Secret access key values.
-
Copy or download your key to use during the Terraform Cloud setup.
Set Up Your Terraform Cloud Workspace
-
Navigate to Terraform Cloud at https://app.terraform.io/session and create a free account (or log in if you have an existing account).
-
Create an organization named "YOUR_NAME".
-
Create a workspace named "dev".
-
Navigate to the Variables tab and add two environment variables: one named "AWS_ACCESS_KEY_ID" with a value of your Access key ID and one named "AWS_SECRET_ACCESS_KEY" with a value of your Secret access key.
-
Navigate to User Settings and then Tokens, and create an API token called "terraform_login".
-
Copy your API token.
Add the Backend Configuration
-
Log in to Terraform Cloud with the API token.
-
Add the backend block provided to the configuration file.
-
Initialize your working directory.
Apply The Updated Configuration and Confirm the State Was Saved to Terraform Cloud
-
Apply your updated configuration.
-
Confirm your state is saved to Terraform Cloud.