Flashcards in terraform Deck (12):
How do you test what infrastructure will be built, without executing the actual infrastructure provision process
Consider these 2 commands: what are the benefits
terraform plan -out changes.terraform
terraform apply changes.terraform
it is a safer way to run rather than plan and apply because it will not regenerate the plan file and therefore you know what you are deploying
What is the difference between a variable and a datasource?
variables are static, and datasources are dynamic
What is local provisioning?
a shell script that will be executed on the host where terraform apply is running
Where does terraform by default saves its remote state?
what are the Terraform command aguments (7)
plan, apply, destroy, show - push, taint, untaint
what is a terraform provider
A provider is responsible for understanding API interactions and exposing resources.
what would you use a variable file in terraform
one location to make changes, hide secrets, and add variable file to .gitignore
what is a provisioner
Provisioners are used to execute scripts on a local or remote machine as part of resource creation or destruction. Provisioners can be used to bootstrap a resource, cleanup before destroy, run configuration management
what are the provisioner options
chef, connection, file, local-exec, remote-exec, null resource, salt masterless
what is a terraform module
Modules in the Terraform ecosystem are a way to organize the code to:
• be more reusable
• avoid code duplication
• improve the code organization and its readability
If we compare them to a programming language, writing a Terraform module is the equivalent of writing a function and calling it many times with different parameters.