SynfraCore
Synfracore
Start Learning
Navigation

Academies

Platform

RoadmapsLabsCertificationsInterviewPYQsAI AssistantCareer
Start Learning Free🗺️ Learning Roadmaps

TerraformNotes

Key takeaways, tips, and important points to remember

✍️
Written by senior engineers. Reviewed for technical accuracy.· Updated 2025 · SynfraCore Terraform Team
Expert Content

Terraform Key Notes

Version Management

Use tfenv for version switching: tfenv install 1.6.6, tfenv use 1.6.6
Pin provider versions in versions.tf — prevents surprise breaking changes
OpenTofu is the open-source fork (after HashiCorp BSL license change Aug 2023) — same syntax

State Management Rules

1.Remote state is mandatory for teams — never local state in shared repos
2.State locking prevents concurrent applies
3.Never manually edit state file — use terraform state mv/rm
4.State contains secrets in plaintext — encrypt at rest (S3 server-side encryption, Azure Blob encryption)

Import Workflow (Bringing Existing Resources Under TF)

1.Write the HCL configuration for the resource
2.terraform import azurerm_resource_group.main /subscriptions/.../resourceGroups/my-rg
3.terraform plan — verify no unexpected changes
4.terraform apply if plan shows no changes

Terraform vs OpenTofu (2024)

TerraformOpenTofu

|-|-----------|----------|

LicenseBSL 1.1 (not fully open source)MPL 2.0 (fully open source)
GovernanceHashiCorp (IBM)CNCF
SyntaxHCLHCL (identical)
CompatibilitySourceDrop-in replacement
StateCompatibleCompatible
Share:
Join our Community
Daily tips, job alerts, interview help — join engineers learning together
Up Next
📝
TerraformPYQ
Previous Year Questions with detailed solutions
Also Worth Exploring
← Back to all Terraform modules
CheatsheetsPYQ