DEV Community

Azmat Ahmed
Azmat Ahmed

Posted on

Week 9 DevOps: Terraform on AWS — Remote State, Modular Code & Best Practices

Hey everyone, I’m Azmat Ahmed!

This week, my Week 9 DevOps journey focused on Terraform — provisioning AWS infrastructure using Infrastructure as Code.

Highlights:

  • Used Terraform commands: terraform init, plan, apply, and destroy
  • Set up remote state storage on AWS S3, with DynamoDB for state locking — critical for collaboration
  • Modularized Terraform files: split EC2, S3, DynamoDB resources into separate .tf files
  • Provisioned EC2 instances, created S3 buckets, and DynamoDB tables with Terraform
  • Followed best practices: never commit .tfstate files, use remote state, version control
  • Ran Terraform on Linux, practiced debugging and deployment

Why Terraform?

Terraform brings the power of Infrastructure as Code — enabling automation, consistency, and scalability for cloud infrastructure.

Sample Terraform file structure:


plaintext
main.tf
variables.tf
ec2.tf
s3.tf
dynamodb.tf
outputs.tf
terraform.tfvars
Let’s connect!
Portfolio: https://azmatahmed.netlify.app

LinkedIn: https://www.linkedin.com/in/azmat-ahmed-13610a314/

Email: ahmedawan9519@gmail.com

Enter fullscreen mode Exit fullscreen mode

Top comments (0)