Use Terraform to create a simple EC2 instance with variables, outputs, and a clean project structure.
Connect Terraform basics to a visible AWS resource and validate end-to-end provisioning.
Set up Terraform files and provider configuration.
Create main.tf and variables.tf
Configure AWS provider
Define instance-related variables
Create the instance resource and supporting values.
Define EC2 resource
Choose test-friendly instance type
Add tags
Add outputs
Apply the project and verify that the instance exists.
Run terraform fmt
Run terraform init
Run terraform validate
Run terraform plan
Run terraform apply
Create Terraform project files.
Define an EC2 instance resource.
Add variables and outputs.
Run init, validate, plan, and apply.
Verify the instance in AWS.
terraform validate succeeds
terraform plan shows EC2 creation
terraform apply completes successfully
AWS console shows the new instance
Outputs return useful values
Terraform project
Variables and outputs
README with architecture and commands
Good proof that you can take Terraform beyond theory and provision a real AWS resource in a structured way.
Using hardcoded values instead of variables
Choosing a region without available AMI
Forgetting outputs
Skipping plan review before apply
Add security group and user data
Put the instance in a Terraform-managed VPC
Add remote state
Expand to an Auto Scaling setup