Terraform/OpenTofu
Terraform
Infrastructure automation to provision and manage resources in any cloud or data center.
Home: Terraform | HashiCorp Developer
Releases: Releases · hashicorp/terraform
Final version with Mozilla Public License: 1.5.7
The newer versions are released under Business Source License.
OpenTofu
The open source infrastructure as code tool
Home: OpenTofu
Releases: Releases · opentofu/opentofu
Basic Terraform commands - Cheat sheet
| Command | Description |
|---|---|
terraform init | Initialize the Terraform directory and download the required provider plugins |
terraform fmt -recursive | Ensure all Terraform code in the current directory and subdirectories is formatted properly |
terraform validate | Validate the syntax of the Terraform configuration files and check for errors |
terraform plan | Show the execution plan, the resources that will be created, updated, or destroyed |
terraform apply | Apply the changes required to reach the desired state of the infrastructure |
terraform destroy | Destroy the Terraform-managed infrastructure |
terraform show | Display the current state of the Terraform-managed infrastructure |
terraform state list | List all resources in the Terraform state |
terraform apply -replace "id" | Force replacement of a resource |
Deployments
terraform/azure-vm– Full module docs: A simple VM on Azure for testing infra deployment.terraform/aws-vm– Full module docs: An EC2 VM with persistent EBS storage and Secrets Manager.