๐ Terraform Commands for DevOps Engineers ๐ Mastering Terraform can greatly enhance your infrastructure management. Hereโs a quick reference to essential Terraform commands: 1๏ธโฃ terraform init - Initialize a Terraform working directory. 2๏ธโฃ terraform validate - Check the configuration for syntax errors. 3๏ธโฃ terraform plan - Generate and show an execution plan. 4๏ธโฃ terraform apply - Apply the changes required to reach the desired state. 5๏ธโฃ terraform destroy - Destroy the Terraform-managed infrastructure. 6๏ธโฃ terraform show - Show the current state or a saved plan. 7๏ธโฃ terraform output - Extract the value of an output variable from the state file. 8๏ธโฃ terraform state - Advanced state management commands: - terraform state list - List resources in the state. - terraform state show - Show a resource in the state. - terraform state rm - Remove a resource from the state. 9๏ธโฃ terraform fmt - Reformat configuration files to the canonical format. 1๏ธโฃ0๏ธโฃ terraform taint - Manually mark a resource for recreation. 1๏ธโฃ1๏ธโฃ terraform untaint - Manually unmark a resource as tainted. 1๏ธโฃ2๏ธโฃ terraform import - Import existing infrastructure into your Terraform state. 1๏ธโฃ3๏ธโฃ terraform refresh - Update the state file with the real infrastructure. ๐ Helpful Links: - Terraform Documentation: https://www.terraform.io/docs/index.html - Terraform Best Practices: https://www.terraform-best-practices.com Keep this cheat sheet handy and automate your infrastructure with confidence! ๐ก โ๏ธ ๐๐ผ๐น๐น๐ผ๐ @devcloudninjas ๐๐จ๐ซ ๐ฆ๐จ๐ซ๐ ๐ฌ๐ฎ๐๐ก ๐๐จ๐ง๐ญ๐๐ง๐ญ ๐๐ซ๐จ๐ฎ๐ง๐ ๐๐ฅ๐จ๐ฎ๐ & ๐๐๐ฏ๐๐ฉ๐ฌ!!!
DevCloud Ninjas Tech Community: post #260 โ TG.ME
November 9, 2024 1.7K 8