Terraform Professional flashcards
Terraform Professional · Build recall with a focused review session.
32 cards. Read the term and the definition here. The deck at the top of this page is optional.
- for expression
- A Terraform expression that builds a list or map by iterating a collection; an optional if clause filters elements, and grouping mode builds maps of lists.
- dynamic block
- Generates repeated nested blocks from a collection using for_each; the iterator argument renames the temporary variable and content defines the block body.
- variable validation block
- Adds condition and error_message to an input variable; condition must be a bool expression and can reference only that variable in current Terraform versions.
- create_before_destroy
- A lifecycle setting that creates the replacement resource before destroying the existing object, useful when zero-downtime replacement or unique names require it.
- moved block
- Declares that a resource or module changed address, so Terraform treats the old address as the same object instead of planning destroy and create.
- try function
- Returns the first argument that evaluates without error; commonly used for safe attribute access when a value may be null or missing.
- state locking
- A backend feature that prevents concurrent operations from corrupting state; supported by backends such as S3 with DynamoDB or lockfile, and HCP Terraform.
- terraform state mv
- Moves a resource or module address within state without changing infrastructure; used to match refactored configuration or reorganize modules.
- import block
- Configuration block that imports an existing object into state; with -generate-config-out Terraform can generate matching HCL for review.
- refresh-only apply
- An apply mode that updates state to match remote objects without changing infrastructure; invoked by terraform apply -refresh-only or plan -refresh-only.
- terraform_remote_state
- Data source that reads outputs from another state file or workspace; it requires backend configuration and exposes only declared outputs, not resource attributes.
- module version constraint
- The version argument on a registry module source; accepts constraints like ~> 1.2 and selects an installable version during terraform init.
- configuration_aliases
- A required_providers setting that declares additional provider configurations a module expects; callers pass them through the module's providers map.
- module for_each
- Meta-argument that instantiates a module once per map or set key; keys must be known at plan time and addresses use module.name["key"].
- child module provider blocks
- Provider blocks inside reusable child modules are discouraged; modules should declare required_providers and receive configurations from the root module.
- registry module address
- A source formatted as namespace/name/provider, optionally with hostname; Terraform resolves it through the public or private module registry.
- cloud block
- A top-level Terraform block that configures HCP Terraform or Terraform Enterprise integration, specifying organization and workspaces for remote runs and state.
- VCS-driven run
- A run queued automatically when a connected repository changes; HCP Terraform plans and applies in its environment using workspace variables and settings.
- run trigger
- A workspace setting that queues a run in a dependent workspace after a source workspace applies successfully; used to chain infrastructure layers.
- variable set
- A reusable collection of Terraform and environment variables applied to workspaces or projects in HCP Terraform; workspace-specific variables can override values.
- remote run apply
- In HCP Terraform, a run moves through plan, policy check, and apply stages; auto-apply or manual confirmation is controlled by workspace settings.
- dependency lock file
- The .terraform.lock.hcl file records selected provider versions and checksums; commit it so installs are reproducible across machines and CI.
- terraform providers lock
- Command that writes lock file entries and checksums for specified platforms, useful when CI runs on a different OS than developers.
- pessimistic constraint
- The ~> operator allows patch updates within a minor version when two segments are given, or minor updates within a major version with one segment.
- provider source address
- An address like registry.terraform.io/hashicorp/aws identifying a provider's registry host, namespace, and type in required_providers.
- terraform init -upgrade
- Re-installs modules and providers while ignoring existing lock file selections where possible, allowing newer versions that satisfy constraints.
- sensitive variable
- Marks an input variable as sensitive so Terraform redacts it in plan and apply output; the value is still stored in plaintext in state.
- ephemeral resource
- A Terraform 1.10+ resource whose data is not persisted to state or plan; useful for short-lived credentials and secrets.
- terraform test file
- A .tftest.hcl file containing run blocks; each run can plan or apply configuration and assert conditions against variables, outputs, or resources.
- mock provider in tests
- Terraform test feature that supplies fake provider responses for resources and data sources, enabling tests without real cloud credentials.
- policy as code
- Automated rules evaluated against plan or state data; Terraform Enterprise uses Sentinel, while OPA or Conftest can consume terraform show -json output.
- check block
- A configuration block that validates conditions during plan and apply and reports warnings without blocking operations; useful for continuous assertions.