meta-argument
An argument Terraform itself understands on any resource or module block, such as count, for_each, depends_on, provider and lifecycle.
In more detail
Ordinary arguments are defined by the provider and describe the object; meta-arguments change how Terraform treats the block, such as how many instances exist or in what order things happen. They are expanded during planning, so the plan shows their effect before anything changes.
Related terms
- count meta-argument — The count argument, which creates that many numbered copies of a resource or module, addressed as name[0], name[1] and so on.
- for_each — The for_each argument, which creates one instance of a resource or module per element of a map or set, addressed by key such as name["a"].
- depends_on meta-argument — The depends_on argument, which tells Terraform one resource must wait for another when no reference shows that relationship.
- lifecycle block — A block inside a resource that changes how Terraform replaces or protects it, with settings such as create_before_destroy, prevent_destroy and ignore_changes.
Taught in
- Scaling Resources With Count — Infrastructure as Code with Terraform
- Iterating Over Maps With For Each — Infrastructure as Code with Terraform
- Explicit Dependencies With Depends On — Infrastructure as Code with Terraform
- Safe Changes With Lifecycle Rules — Infrastructure as Code with Terraform
- Provisioners: Why They Are A Last Resort — Infrastructure as Code with Terraform
- Versions, The Lock File And Provider Aliases — HashiCorp Terraform Associate (004) Exam Prep
- Count, For Each And Dynamic Blocks — HashiCorp Terraform Associate (004) Exam Prep
- Dependencies, depends_on And Lifecycle Rules — HashiCorp Terraform Associate (004) Exam Prep