Terraform basics: providers, resources, and state

6161
0

Terraform is an infrastructure as code (IaC) tool that provisions cloud resources declaratively. Configuration files use HCL (HashiCorp Configuration Language). The provider block configures cloud providers like AWS, GCP, or Azure. resource blocks define infrastructure components. terraform init downloads providers. terraform plan previews changes. terraform apply provisions infrastructure. State files track managed resources—store them remotely in S3 or Terraform Cloud for team collaboration. The terraform.tfvars file sets variable values. data sources read existing infrastructure. output values expose resource attributes. Backend configuration determines where state is stored. The plan-apply workflow ensures predictable infrastructure changes.