Beginner LevelCloud Computing (AWS/GCP/Azure)
What is Infrastructure as Code (IaC) and how does Terraform manage cloud resources?
❓ Interview Prompt: Explain Infrastructure as Code (IaC), HashiCorp Configuration Language (HCL), declarative syntax, and state management.
Infrastructure as Code (IaC) is the practice of managing and provisioning cloud infrastructure using machine-readable definition files rather than manual web console clicks.
Why Terraform (HashiCorp):
•
Declarative Approach: Developers write HCL code describing the desired end state of infrastructure. Terraform calculates execution steps to reach that state.
•
Provider Ecosystem: Multi-cloud support (AWS, GCP, Azure, Kubernetes, GitHub).
•
State File ('.tfstate'): Tracks mapping between code resource declarations and real-world cloud metadata.
•
Core Workflow: 'terraform init' $\rightarrow$ 'terraform plan' $\rightarrow$ 'terraform apply'.
Code Implementation Example
hcl
# Standard Terraform workflow declaration
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
provider "aws" {
region = "us-east-1"
}
resource "aws_s3_bucket" "my_bucket" {
bucket = "company-app-assets-2026"
}💡Declarative Terraform HCL resource configuration.
🎯 Interview Key Takeaway
Terraform uses declarative HCL configuration files to provision and reconcile cloud infrastructure against state files.
#Terraform#IaC#HCL#DevOps#Beginner
Back to all Cloud Computing (AWS/GCP/Azure) Questions→