Reference
- Terraform Registry
Official
- Managed by terraform.Verified
- Managed by terraform partners.Community
- Managed by users.
main.tf
- Main configuration file containing resource definition.variables.tf
- Contains variable declarations.outputs.tf
- Contains outputs from resources.provider.tf
- Contains provider derfinition.
string
- a sequence of Unicode characters representing some text, like "hello".number
- a numeric value. The number type can represent both whole numbers like 15 and fractional values like 6.283185.bool
- a boolean value, either true or false. bool values can be used in conditional logic.list (or tuple)
- a sequence of values, like ["one", "two"]. Elements in a list or tuple are identified by consecutive whole numbers, starting with zero.map (or object)
- a group of values identified by named labels, like {name = "Mabel", age = 52}.
Terraform loads variables in the following order, with later sources taking precedence over earlier ones:
- Environment variables
- The terraform.tfvars file, if present.
- The terraform.tfvars.json file, if present.
- Any *.auto.tfvars or *.auto.tfvars.json files, processed in lexical order of their filenames.
- Any -var and -var-file options on the command line, in the order they are provided. (This includes > variables set by a Terraform Cloud workspace.)
depends_on
-depends_on = [(Resource type).(Resource name)]
The arguments available within a lifecycle
block are create_before_destroy
, prevent_destroy
, ignore_changes
, and replace_triggered_by
create_before_destroy
- boolprevent_destroy
- boolignore_changes
- list of attribute namesreplace_triggered_by
- list of resource or attribute references
init
- Prepare your working directory for other commandsvalidate
- Check whether the configuration is validplan
- Show changes required by the current configurationapply
- Create or update infrastructuredestroy
- Destroy previously-created infrastructure
console
- Try Terraform expressions at an interactive command promptfmt
- Reformat your configuration in the standard styleforce-unlock
- Release a stuck lock on the current workspaceget
- Install or upgrade remote Terraform modulesgraph
- Generate a Graphviz graph of the steps in an operationimport
- Associate existing infrastructure with a Terraform resourcelogin
- Obtain and save credentials for a remote hostlogout
- Remove locally-stored credentials for a remote hostoutput
- Show output values from your root moduleproviders
- Show the providers required for this configurationrefresh
- Update the state to match remote systemsshow
- Show the current state or a saved planstate
- Advanced state managementtaint
- Mark a resource instance as not fully functionaltest
- Experimental support for module integration testinguntaint
- Remove the 'tainted' state from a resource instanceversion
- Show the current Terraform versionworkspace
- Workspace management