Terraform Cheat Sheet
Terraform Cheat Sheet
Terraform Cheat Sheet
© Nic Wortel, Software Consultant & Trainer - Last update: August 18, 2023 - Find more cheat sheets at https://nicwortel.nl/cheat-sheets
Terraform Cloud / Remote Authentication Conditional Expressions
Command Description Syntax Description
terraform login Log in to Terraform Cloud If condition is true, return true, otherwise return
condition ? true : false
false
terraform login <hostname> Log in to a different host
terraform logout Log out of Terraform Cloud
Splat Expressions
terraform logout <hostname> Log out of a different host
Syntax Description
Return a list of values for the given attribute of all
Managing workspaces <RESOURCE_TYPE>.<NAME>[*].<ATTRIBUTE>
instances of a resource
Command Description
terraform workspace list List all existing workspaces Resource Meta-Arguments
terraform workspace show Show the name of the current workspace Argument Description
terraform workspace select <name> Select a different workspace depends_on Explicitly specify resource dependencies
terraform workspace new <name> Create a new workspace count Create multiple instances of a resource
terraform workspace delete <name> Delete an existing workspace Create an instance of a resource for each element in
for_each
a map or set
terraform version Show the current Terraform version Create the new resource before destroying the old
create_before_destroy
one
terraform -help Show help output for Terraform
prevent_destroy Prevent Terraform from destroying the resource
terraform -help <command> Show help output for a specific Terraform command
ignore_changes Ignore changes to specific resource attributes
© Nic Wortel, Software Consultant & Trainer - Last update: August 18, 2023 - Find more cheat sheets at https://nicwortel.nl/cheat-sheets