#Introduction
In this tutorial, to learn about Terraform commands cheat sheet.
Terraform commands cheat sheet.
Initialize the terraform stack and download provider plugins as per provider and also verify the syntax
#terraform init
How to display the preview of the resources that are going to be created, updated, and destroyed.
#terraform plan
Build or change infrastructure.
#terraform apply
Destroy terraform-managed infrastructure.
#terraform destroy
Run plan or apply or destroy only to the target resource
#terraform plan -target=resource
#terraform apply -target=resource
#terraform destroy -target=resource
Show human-readable output from Terraform state.
#terraform show
How to validate terraform syntax
#terraform validate
Rewrites terraform code to a canonical format. This useful run command before git commit that codes very nicely formatted.
#terraform fmt
Manually mark a resource for re-creation
#terraform taint
Download and install modules for the configurations. When you update the module.
#terraform get
Create a visual dependency graph of resources.
#terraform graph
Configure remote state storage.
#terraform remote
Use this command for advanced state management.
#terraform state
Conclusion
You have learned about Terraform commands cheat sheet. I hope will this your helpful. Thank you for reading the DevopsRoles page!