Terraform Essentials

Chetan TalwekarChetan Talwekar
2 min read

What is Terraform: IAC tool allows you to define and provision infrastructure resources across multiple cloud provider using declarative configuration language. Manage, version able, reusable and sharable.

Terraform vs Other IAC tool

\>AWS Cloud formation >Pulimi

AWS CloudFormationTerraform
• AWS-specific only• Multi-cloud provider support
• JSON/YAML templates• HCL (HashiCorp Configuration Language)
• Built-in rollback functionality• State-based management
• Tight AWS integration• Provider plugin architecture

Terraform Workflow

Write »»»»Plan »»»»Apply

HCLProvidersState
HashiCorp Configuration LanguagePlugins for cloud platformsMaps real-world resources to config
Declarative syntax for defining infrastructure(AWS, Azure, GCP, etc.)Stored locally or remotely
Human-readable and JSON compatibleSaaS providers (GitHub, DataDog)(S3, Terraform Cloud)
Interface to infrastructure platformsEnables collaborative workflows

Essential Terraform Commands

CommandPurpose
terraform initInitialize directory
terraform planPreview changes
terraform applyCreate/update infrastructure
terraform destroyDelete infrastructure
terraform validateCheck configuration syntax
CommandPurpose
terraform fmtFormat code
terraform stateAdvanced state management
terraform importImport existing resources
terraform workspaceManage environments
terraform outputView outputs

Days-wise Modules and Target to learn Terraform

Week 1: Terraform Foundations and Cloud Platform Integration

Day 1: Terraform Fundamentals

Day 2: Terraform Basics - Core Workflow

Day 3: Variables and State Management

Day 4: Modules and Resource Organization

Day 5: Provisioning on a Cloud Platform

Day 6: Provisioning More Complex Resources

Week 2: Advanced Terraform and Best Practices

Day 7: Templating and Loops

Day 8: Conditionals and Complex Logic

Day 9: Testing and Validation

Day 10: Version Control and Collaboration

Day 11: Terraform Best Practices

Day 12: Real-World Infrastructure Management

0
Subscribe to my newsletter

Read articles from Chetan Talwekar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Chetan Talwekar
Chetan Talwekar