1. Why create an IAM user instead of using root?
- Root is faster
- Safer — limited permissions, rotatable keys
- Terraform requires root
- IAM is deprecated
Source: doonops-curriculum/setup-cli--project-layout.md
Doonops lesson
Learn which file holds what — so projects do not become one giant messy file.
Split recipe into small notebooks: versions, cloud login, settings (variables), main dishes (resources), results (outputs).
Separation of concerns: versions.tf, providers.tf, variables.tf, main.tf, outputs.tf; .gitignore for state and secrets.
Kitchen drawers: spices (variables), appliances (providers), cooking steps (main), plated food photo (outputs).
Layman words first, then technical detail — read slowly
versions.tf — minimum Terraform version (which app version)providers.tf — which cloud + region (which shop you order from)variables.tf — adjustable knobs (size, name, environment)main.tf — actual servers, networks, databasesoutputs.tf — print useful results after apply (IP, URL).gitignore — never upload secrets or state to GitHubyour-project/ versions.tf providers.tf variables.tf main.tf outputs.tf .gitignore
Modern HCL — names are examples, not from any third-party course
# .gitignore .terraform/ *.tfstate* *.pem .terraform.lock.hcl
Terraform runs on your computer — copy this HCL into a folder, then follow the local lab steps below.
Full implementation folder — copy all files, then run terraform commands
Copy every file below into one folder — same as a real repo module. Then run the local lab steps.
Suggested folder: Suggested path: ~/doonops-terraform/04-layout/
versions.tfSee file purpose in the code belowterraform {
required_version = ">= 1.9.0"
}
2–3 quick questions before the next module
Quick check — did this module stick?
1. Why create an IAM user instead of using root?
2. Command to verify AWS CLI works locally?