Day 1 – Cloud Primitives and Terraform
Today's Focus
Understand cloud service models and core primitives, then provision your first cloud resources with Terraform.
Tasks
- Map the three service models to concrete examples: IaaS (you manage the OS — e.g. EC2, GCE VM), PaaS (provider manages runtime — e.g. Cloud Run, Elastic Beanstalk), managed services (fully abstracted — e.g. RDS, S3). For each model, write the tradeoff in terms of control vs operational burden.
- Install Terraform and the AWS CLI (or GCP/Azure equivalent). Configure credentials:
aws configuresets~/.aws/credentials. Runaws sts get-caller-identityto confirm authentication. Never hard-code credentials in Terraform files — use environment variables or credential files. - Write a minimal
main.tfthat provisions a VPC with a CIDR block, one public subnet, and an internet gateway. Runterraform init,terraform plan, andterraform apply. Read the plan output carefully before applying. - Inspect
terraform.tfstate: find your VPC resource and its attributes. Understand why this file must be stored remotely (S3 + DynamoDB lock) in a team environment — add abackendblock to your config but comment it out for now. - Add a
variables.tfwithvariable "region",variable "env_name", andvariable "cidr_block". Move all hard-coded values out ofmain.tfinto these variables. Create aterraform.tfvarsfile for your values and add it to.gitignore. - Run
terraform destroyand verify all resources were removed. Confirm in the AWS console that nothing was left behind.
Reading / Reference
- Terraform: Get Started with AWS — official tutorial series.
- Terraform Language Documentation — Resources, Variables, Outputs.
- AWS: VPC concepts.