Build, change, and destroy AWS infrastructure using Terraform. Step-by-step, command-line tutorials will walk you through the Terraform basics for the first time.
What is Infrastructure as Code and Why is Terraform Useful?
Install Terraform on Mac, Linux, or Windows by downloading the binary or using a package manager (Homebrew or Chocolatey). Then create a Docker container locally by following a quick-start tutorial to check that Terraform installed correctly.
Authenticate to AWS, and create an EC2 instance under the AWS free tier. You will write and validate Terraform configuration, initialize a configuration directory, and plan and apply a configuration to create infrastructure.
Modify EC2-instance configuration to use a different Ubuntu version. Plan and apply the changes to re-provision a new instance that reflects the new configuration. Learn how Terraform handles infrastructure change management.
Completely destroy the AWS infrastructure that Terraform manages in a configuration with a single command. Evaluate the plan and confirm the destruction.
Declare your AWS region as a variable. Reference the variable in Terraform configuration. Define variables using command line flags, environment variables, .tfvars files or default values.
Declare output variables to display the public IP address of an EC2 instance. Display all outputs and query specific outputs. Define what data stored in Terraform state is relevant to the operator or end user.
Configure Terraform to store state in Terraform Cloud remote backend. Add a remote state block directly to configuration or set an environment variable to load remote state configuration when Terraform initializes.