base Flashcards
(19 cards)
Name all provisioner types
- Creation-time provisioner
- Destroy-time provisioner
Where would you use a provisioner?
In a resource block
What is state?
Maps real-world resources to terraform configuration
How is dependency metadata tracked?
State file track dependency metadata
Name 3 terraform state commands:
- terraform state list
- terraform state show <resource></resource>
- terraform state rm <resource></resource>
Name advantages of storing state remotely:
- enables distributed teams
- security rules -> granular access
- allows locking state so parallel executions don’t coincide
- enables sharing “output” values with other Terraform configuration or code
terraform init fails with remote state (S3). Why?
S3 bucket does not exist (must exist before init execution)
What is a module?
a module is a container for multiple resources that are used together
How can you download a module?
- Terraform Public Registry
- private registry
- local system
modules can optionally take input and provide outputs to plug back into your main code. True?
True
the outputs declared inside Terraform module code can be fed back into the root module or your main code. True?
True
Name all primitive types:
- string
- number
- bool
(4. any)
What complex types are there?
- Collection type
- Structural type
Define collection type
Collection types allow multiple values of one primitive type to be grouped together
Define structural type
A structured type allows multiple values of different types
Name all collection types:
- list
- set
- map
Name all structural types
- object(type)
- tuple(type)
Name all block types that support dynamic blocks:
- resource
- data
- provider
- provisioner
Where can dynamic blocks not be used?
Dynamic blocks CANNOT be used with lifecycle blocks