Install Terraform, understand HCL syntax, configure a provider, and provision your first cloud resource.
Learn the core concepts of HCL Basics and Your First Resource and apply them in practical exercises.
You describe the infrastructure you want in HCL files. Terraform talks to cloud APIs to create, update, or delete resources to match your description. The same config works across AWS, GCP, Azure, and 800+ other providers.
# Download from terraform.io/downloads # Mac: brew install hashicorp/tap/terraform terraform --version
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
# Create an S3 bucket
resource "aws_s3_bucket" "my_bucket" {
bucket = "my-unique-bucket-name-12345"
tags = {
Environment = "dev"
Project = "terraform-course"
}
}
terraform init # download providers terraform plan # preview changes terraform apply # apply changes (prompts for confirmation) terraform destroy # tear everything down
terraform plan before every apply. It shows exactly what will be created, modified, or destroyed — like a dry run. Review it carefully. Surprises in plan are much better than surprises in production.Before moving on, confirm understanding of these key concepts: