004 — HashiCorp Certified: Terraform Associate Quick Reference

Compact review for HashiCorp Certified: Terraform Associate (004): Terraform workflow, HCL, providers, state, modules, backends, workspaces, and CLI commands.

Exam Identity

ItemReference
Vendor/providerHashiCorp
Official exam titleHashiCorp Certified: Terraform Associate (004)
Official exam code004
Page purposeIndependent quick reference for real-exam preparation and original practice support

Use this page to quickly review the Terraform CLI workflow, configuration language, state behavior, providers, modules, and managed-workflow concepts that commonly drive exam questions.

Terraform Core Model

ConceptWhat it doesExam distinction
TerraformInfrastructure as code tool for defining, planning, and applying infrastructure changesDeclarative: describe desired end state, not step-by-step procedures
Configuration.tf / .tf.json files written in HCL or JSONTerraform loads all files in the working directory as one configuration
ProviderPlugin that lets Terraform manage a target platform or serviceProvider exposes resource types and data sources
ResourceManaged infrastructure objectTerraform creates, updates, replaces, or destroys it
Data sourceReads external or existing informationDoes not create infrastructure
StateMapping between configuration and real remote objectsRequired for tracking, planning, dependencies, and drift detection
PlanProposed execution graph and change setShows intended changes before apply
ApplyExecutes a planCan apply an already saved plan or create a new plan interactively
ModuleContainer for Terraform configurationEvery configuration has a root module; child modules are reusable
BackendWhere state is stored and how operations may be coordinatedSome backends support remote state locking and remote operations
WorkspaceSeparate state instance for the same configurationUseful for environment separation in limited cases; not a substitute for all environment design

Standard Terraform Workflow

    flowchart LR
	    A[Write configuration] --> B[terraform fmt]
	    B --> C[terraform init]
	    C --> D[terraform validate]
	    D --> E[terraform plan]
	    E --> F[terraform apply]
	    F --> G[terraform show / output]
	    G --> H[Change config]
	    H --> D
StepCommandPurposeCommon exam trap
Formatterraform fmtRewrites configuration to canonical styleFormatting does not validate provider credentials or remote APIs
Initializeterraform initDownloads providers/modules and configures backendRequired before plan/apply in a new or changed working directory
Validateterraform validateChecks syntax and internal consistencyDoes not contact all remote APIs to prove resources can be created
Planterraform planBuilds proposed changesA plan is not a guarantee that apply will succeed
Applyterraform applyCreates/updates/destroys infrastructureWithout saved plan, Terraform creates a fresh plan before applying
Destroyterraform destroyRemoves managed infrastructureEquivalent intent to planning/applying destroy actions
Inspectterraform show, terraform state, terraform outputReads state, plans, or outputsoutput is for declared output values, not arbitrary state browsing

High-Yield CLI Command Matrix

CommandUse whenKey options / notes
terraform versionConfirm CLI version and provider selectionsHelpful for troubleshooting lock-file or version mismatch issues
terraform initStart using a configuration, backend, provider, or moduleRe-run after changing backend, modules, or required providers
terraform init -upgradeUpgrade provider/module selections within version constraintsUpdates selections; do not confuse with normal init
terraform fmtNormalize HCL formattingUse -recursive to format subdirectories
terraform validateCheck configuration validityRequires initialized providers for complete validation
terraform planPreview changesUse -out=FILE to save an exact plan
terraform applyExecute changesterraform apply FILE applies a saved plan
terraform destroyDestroy managed objectsOften used for teardown in temporary environments
terraform outputRead root module outputs-json is useful for automation
terraform showDisplay state or plan contents-json produces machine-readable output
terraform state listList tracked resource addressesState inspection only; does not query all cloud inventory
terraform state show ADDRESSInspect one tracked objectUseful for ID and attribute review
terraform state mvRename/move state bindingUsed when refactoring addresses without replacing infrastructure
terraform state rmStop tracking an objectDoes not destroy the remote object
terraform importBind existing infrastructure to a resource addressRequires matching configuration for normal ongoing management
terraform taint / untaintMark resource for replacement / undoSuperseded in many workflows by -replace, but still exam-relevant
terraform apply -replace=ADDRESSForce replacement during applySafer, explicit replacement targeting
terraform workspace listShow workspacesCurrent workspace is marked
terraform workspace new NAMECreate workspaceCreates separate state for same configuration
terraform workspace select NAMESwitch workspaceBe careful before plan/apply
terraform providersShow provider requirementsUseful for module/provider troubleshooting
terraform graphOutput dependency graphProduces DOT format for visualization
terraform consoleEvaluate expressions interactivelyUseful for functions, variables, and type behavior
terraform loginStore credentials for HCP Terraform/Terraform EnterpriseWrites credentials for remote service access
terraform logoutRemove stored credentialsCleans CLI credentials

Configuration File Roles

File patternCommon purposeRequired?
main.tfMain resources, modules, data sourcesNo; naming is conventional
variables.tfInput variable declarationsNo
outputs.tfOutput declarationsNo
providers.tfProvider and Terraform settingsNo
versions.tfRequired Terraform and provider constraintsNo, but common
terraform.tfvarsVariable valuesNo; auto-loaded if present
*.auto.tfvarsVariable values auto-loaded by lexical orderNo
.terraform.lock.hclDependency lock file for providersCreated/updated by init; should usually be committed for reproducibility
.terraform/Local working directory dataDo not treat as source configuration
terraform.tfstateLocal state file if using local backendProtect carefully; often replaced by remote backend in teams

Terraform Block and Provider Requirements

terraform {
  required_version = ">= 1.6.0"

  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }

  backend "s3" {
    bucket = "example-tf-state"
    key    = "network/terraform.tfstate"
    region = "us-east-1"
  }
}

provider "aws" {
  region = var.region
}
BlockPurposeExam notes
terraformConfigures Terraform behaviorIncludes required version, required providers, and backend
required_versionConstrains Terraform CLI versionProtects configuration from unsupported CLI versions
required_providersDeclares provider source and version constraintRequired for clear provider dependency management
providerConfigures provider instanceCredentials are commonly supplied outside code via environment, profile, or remote workspace variables
backendConfigures state storageBackend blocks cannot use normal input variables

Version Constraint Quick Reference

ConstraintMeaning
= 1.5.7Exactly this version
!= 1.5.7Exclude this version
> 1.5.0, >= 1.5.0Greater than / greater than or equal
< 2.0.0, <= 2.0.0Less than / less than or equal
~> 1.5.0Compatible patch releases: >= 1.5.0 and < 1.6.0
~> 1.5Compatible minor releases: >= 1.5.0 and < 2.0.0

Common trap: provider version constraints define allowed versions; .terraform.lock.hcl records selected versions. terraform init -upgrade can choose newer versions allowed by constraints.

Resource, Data Source, and Output Syntax

resource "aws_instance" "web" {
  ami           = data.aws_ami.al2023.id
  instance_type = var.instance_type

  tags = {
    Name = "${var.environment}-web"
  }
}

data "aws_ami" "al2023" {
  most_recent = true
  owners      = ["amazon"]
}

output "web_instance_id" {
  value       = aws_instance.web.id
  description = "ID of the web instance"
}
ConstructAddress formPurpose
Resourceaws_instance.webManaged object
Data sourcedata.aws_ami.al2023Read-only lookup
Outputoutput.web_instance_id conceptually; accessed by nameExposes values from root or child module
Modulemodule.networkChild module call
Count instanceaws_instance.web[0]Numeric index
For-each instanceaws_instance.web["blue"]Keyed instance

Input Variables, Locals, and Outputs

variable "environment" {
  type        = string
  description = "Deployment environment"
  nullable    = false

  validation {
    condition     = contains(["dev", "stage", "prod"], var.environment)
    error_message = "environment must be dev, stage, or prod."
  }
}

variable "tags" {
  type    = map(string)
  default = {}
}

locals {
  common_tags = merge(var.tags, {
    Environment = var.environment
    ManagedBy   = "Terraform"
  })
}

output "common_tags" {
  value     = local.common_tags
  sensitive = false
}
ItemUse forKey distinction
Input variableExternal parameter to a moduleValues are assigned from CLI, files, environment, defaults, or calling module
Local valueInternal named expressionCannot be overridden from outside
Output valueReturn value from moduleRoot outputs display after apply; child outputs are accessed as module.name.output
sensitive = trueRedact value in CLI outputSensitive values can still exist in state; protect state
validationEnforce input rulesRuns during plan/apply validation
nullable = falsePrevent null assignmentUseful for required explicit values

Variable Value Precedence

Highest priority wins.

PrioritySource
High-var and -var-file command-line options
*.auto.tfvars / *.auto.tfvars.json files
terraform.tfvars / terraform.tfvars.json
Environment variables named TF_VAR_name
LowVariable default value

If no value is available and no default exists, Terraform prompts interactively unless input is disabled.

Type System Reference

TypeExampleNotes
string"prod"Text
number3Numeric values
booltrueBoolean
list(string)["a", "b"]Ordered, same element type
set(string)toset(["a", "b"])Unordered, unique values
map(string){ env = "prod" }String keys, same value type
object({...})object({ name = string, size = number })Named attributes with defined types
tuple([...])tuple([string, number])Ordered elements with possibly different types
anyanyAvoid unless truly flexible
nullnullOmits or unsets an argument in many contexts

Expressions and Functions

PatternExampleUse
Referencevar.region, aws_vpc.main.idAccess object attributes
String template"web-${var.environment}"Interpolate values
Conditionalvar.create ? 1 : 0Choose between two expressions
For expression list[for s in var.subnets : s.id]Transform list
For expression map{ for s in var.subnets : s.name => s.id }Build map
Splataws_instance.web[*].idCollect attribute from multiple instances
Dynamic blockdynamic "ingress" { ... }Generate nested blocks
Type conversiontolist(var.ids), toset(var.ids)Normalize types

Common Functions

FunctionTypical use
length()Count elements or characters
lookup()Read map value with default
merge()Combine maps; later keys win
concat()Combine lists
contains()Test if list/set contains value
coalesce()First non-null, non-empty string argument
try()Fallback when expression errors
can()Test whether expression can be evaluated
file()Read local file content
templatefile()Render template file with variables
jsonencode()Produce JSON from Terraform values
yamldecode()Parse YAML into Terraform values
flatten()Flatten nested lists
setproduct()Cartesian product of sets/lists
cidrsubnet()Derive subnet CIDR blocks
timestamp()Current timestamp; can cause changing plans if used carelessly

Meta-Arguments and Lifecycle

Meta-argumentApplies toPurposeTrap
countResources, modules, some blocksCreate N instances by numeric indexIndex changes can cause unintended replacement
for_eachResources, modules, dynamic blocksCreate instances by stable keysUsually safer than count for named objects
depends_onResources, modulesExplicit dependencyUse only when implicit references are insufficient
providerResources, modulesSelect provider configuration or aliasNeeded for multiple provider instances
lifecycleResourcesCustomize create/update/destroy behaviorDoes not override provider/API reality
provider "aws" {
  alias  = "west"
  region = "us-west-2"
}

resource "aws_s3_bucket" "logs" {
  provider = aws.west
  bucket   = var.bucket_name

  lifecycle {
    prevent_destroy = true
  }
}

Lifecycle Rules

Lifecycle argumentEffectExam note
create_before_destroyAttempts replacement by creating new object firstRequires remote platform to allow overlapping objects
prevent_destroyBlocks plans that would destroy objectMust be removed or changed before destruction can proceed
ignore_changesIgnores selected attribute driftUseful for externally managed fields; can hide real drift
replace_triggered_byReplaces when referenced object/expression changesExplicit replacement dependency

Dependency Graph and Planning

Dependency sourceExampleNotes
Implicit dependencyResource references another resource attributePreferred; Terraform infers order
Explicit dependencydepends_on = [aws_iam_role.app]Use for hidden dependencies not visible through expressions
Provider dependencyResource requires provider configurationInitialized through provider plugin
Destroy dependencyTerraform calculates safe destroy orderUsually reverse of creation dependencies
Unknown values(known after apply) in planValues are not known until provider creates or reads object

Plan symbols often seen in CLI output:

SymbolMeaning
+Create
-Destroy
~Update in place
-/+ or +/-Replace
<=Read data source
-/+ with reasonAttribute or lifecycle rule requires replacement

State Essentials

State conceptWhat to remember
State maps addresses to remote object IDsWithout state, Terraform cannot know which real objects it manages
State stores attributesMay contain sensitive values; secure it
State supports dependency metadataHelps order operations
State enables drift detectionRefresh compares state with remote objects
State should not be manually editedUse Terraform commands whenever possible
Remote state improves collaborationCentral storage, access control, and locking depend on backend/service capabilities

State Commands

TaskCommandEffect
List tracked objectsterraform state listShows addresses
Inspect objectterraform state show ADDRESSShows attributes stored in state
Move addressterraform state mv OLD NEWChanges binding without remote change
Remove bindingterraform state rm ADDRESSForgets object; does not destroy it
Pull stateterraform state pullWrites current state to stdout
Push stateterraform state pushReplaces remote state; use cautiously

State Refactoring Options

ScenarioBest toolWhy
Rename resource block but keep same objectmoved block or terraform state mvAvoids destroy/recreate due to address change
Split configuration into modulesmoved block or state movePreserves bindings
Stop managing object but leave it runningterraform state rmRemoves from state only
Bring existing object under Terraformterraform import plus configurationCreates state binding
Force replacement of one objectterraform apply -replace=ADDRESSExplicit replacement without broad targeting
moved {
  from = aws_instance.web
  to   = aws_instance.app
}

Import Reference

Terraform import associates an existing remote object with a Terraform resource address. It does not automatically guarantee complete, correct configuration for future management.

resource "aws_s3_bucket" "existing" {
  bucket = "example-existing-bucket"
}
terraform import aws_s3_bucket.existing example-existing-bucket
terraform plan
Import stepPurpose
Write or generate resource configurationTerraform needs a resource address to bind
Run terraform import ADDRESS IDAdd binding to state
Run terraform planDetect missing arguments, drift, or changes Terraform would make
Adjust configurationAlign desired configuration with actual object

Backends and State Storage

Backend conceptMeaningExam distinction
Local backendStores state on local diskSimple but poor for team collaboration
Remote backendStores state in remote service/storageBetter for sharing, locking, and security depending on backend
Backend configurationDefined in terraform block or partial configBackend blocks cannot use normal variables
State lockingPrevents concurrent writesSupport depends on backend
Backend migrationMoving state from one backend to anotherterraform init prompts or options guide migration
terraform {
  backend "remote" {
    organization = "example-org"

    workspaces {
      name = "network-prod"
    }
  }
}

Common trap: backend is not a provider. Providers manage infrastructure APIs; backends store Terraform state and coordinate operations.

Workspaces

Workspace typeMeaning
CLI workspaceNamed state instance for a single configuration and backend
HCP Terraform workspaceManaged unit for runs, variables, state, VCS integration, and settings
Default workspaceCreated automatically for CLI workspaces
Use workspaces whenAvoid relying only on workspaces when
You need multiple state instances for similar configurationEnvironments require significantly different access, topology, or lifecycle
You want quick separation such as dev and test for the same root moduleStrong isolation, separate credentials, or separate repositories are required
Backend supports clean workspace state separationNaming mistakes could apply changes to the wrong environment
terraform workspace list
terraform workspace new dev
terraform workspace select dev
terraform plan

Modules

Module conceptReference
Root moduleCurrent working directory
Child moduleCalled by a module block
Published moduleRetrieved from registry, VCS, local path, or archive source
Module inputVariable declared in child and assigned in module block
Module outputOutput declared in child and accessed as module.name.output
Module versionPin or constrain modules from registries for repeatability
module "network" {
  source  = "app.terraform.io/example-org/vpc/aws"
  version = "~> 1.2"

  cidr_block  = var.vpc_cidr
  environment = var.environment
}

output "vpc_id" {
  value = module.network.vpc_id
}

Module Source Decision Table

Source typeExampleNotes
Local path./modules/vpcGood for same repository
Public registryhashicorp/consul/awsSupports version argument
Private registryapp.terraform.io/org/name/providerCommon in HCP Terraform/Terraform Enterprise
Gitgit::https://example.com/repo.git//modules/vpc?ref=v1.0.0Pin with ref for reproducibility
HTTP archiveURL to archiveLess common; ensure integrity and repeatability

Module Traps

TrapCorrection
Changing module source but not reinitializingRun terraform init
Referencing child resource directly from rootExpose needed value through child output
Using unpinned remote module sourcePin versions or refs for stable runs
Confusing provider inheritanceChild modules can inherit default providers, but aliases often need explicit passing
Assuming module equals separate stateModules share the root module state unless split into separate configurations/backends

Provider Configuration and Aliases

provider "aws" {
  region = "us-east-1"
}

provider "aws" {
  alias  = "dr"
  region = "us-west-2"
}

module "replica" {
  source = "./modules/replica"

  providers = {
    aws = aws.dr
  }
}
NeedUse
One default provider configurationSingle provider block
Multiple regions/accounts/endpointsProvider aliases
Pass aliased provider to child moduleproviders map in module block
Control provider versionsrequired_providers in terraform block
Authenticate securelyEnvironment variables, profiles, workload identity, or remote workspace secrets rather than hardcoding

Provisioners

ProvisionerUseExam guidance
local-execRuns command on machine running TerraformNot idempotent by default; use sparingly
remote-execRuns command on created remote resourceRequires connection details; fragile
fileCopies files to remote resourceRequires connection details
Creation-time provisionerRuns after createFailure may taint resource
Destroy-time provisionerRuns before destroyMust still be reachable and configured

Prefer provider-native resources, image baking, cloud-init/user data, configuration management, or platform automation over provisioners when possible. Provisioners are a last resort.

HCP Terraform and Terraform Enterprise Concepts

ConceptWhat it providesExam distinction
HCP TerraformHashiCorp-managed Terraform workflow platformRemote state, runs, variables, VCS workflows, registry, teams, policy features depending on edition/configuration
Terraform EnterpriseSelf-hosted distribution for organizationsSimilar workflow concepts, operated by the customer
WorkspaceUnit of state, variables, runs, and settingsNot identical to CLI workspace behavior
Remote runPlan/apply executed remotelyKeeps credentials and execution environment centralized
VCS-driven workflowRuns triggered from version control changesCommon team workflow
CLI-driven workflowLocal CLI starts remote operationsUseful when retaining CLI workflow with remote execution/state
API-driven workflowAutomation triggers runs through APICI/CD integration pattern
Variable setsReusable variables across workspacesHelps standardize environment/global values
Private registryInternal module/provider sharingPromotes reuse and governance
Policy as codeRules checked against plansSentinel is HashiCorp’s policy as code framework
Run tasksIntegrations during run workflowCan connect external checks or tools

Terraform Cloud/Enterprise Workflow Distinctions

WorkflowChoose whenWatch for
Local CLI with local stateSolo experiments, disposable labsPoor collaboration and state protection
Local CLI with remote backendCLI workflow plus shared stateCredentials may still be local unless using remote execution
HCP Terraform remote executionTeam workflow with centralized runs and variablesUnderstand workspace configuration and variable handling
VCS-driven remote runsPull request / merge-based infrastructure changesPlan and apply behavior depends on workspace settings
API-driven runsExternal automation orchestrates TerraformRequires token and run lifecycle handling

Security and Sensitive Data

AreaBest practiceExam trap
Provider credentialsUse environment variables, profiles, dynamic credentials, or workspace variablesDo not hardcode secrets in .tf files
StateStore remotely with access control and locking where possiblesensitive = true does not remove values from state
Variable filesKeep secret .tfvars out of public repositoriesAuto-loaded files can accidentally leak values
OutputsMark sensitive outputs with sensitive = trueRedacts display, not necessarily storage
ModulesUse trusted sources and pin versionsUnpinned modules can change unexpectedly
PlansTreat saved plan files as sensitivePlans may contain secret values
Lock fileCommit .terraform.lock.hcl for provider reproducibilityDeleting it can change provider selections on init

Drift, Refresh, and Reconciliation

SituationTerraform behavior
Remote object changed outside TerraformPlan may show drift and propose correction
Remote object deleted outside TerraformPlan may propose recreation
Configuration changedPlan compares desired config with refreshed state
State changed without remote changePlan may propose unexpected actions
ignore_changes usedSelected drift may be ignored
Data source value changedDependent resources may update or replace depending on attributes

Useful review command pattern:

terraform init
terraform validate
terraform plan
terraform show

Targeting and Replacement

OptionUseCaution
-target=ADDRESSFocus operation on specific resource/module and dependenciesFor exceptional recovery, not routine workflow; can create partial convergence
-replace=ADDRESSForce replacement of one resource instanceClearer than taint-based workflow
terraform taint ADDRESSMark object for replacement in next planLeaves state marked until replacement or untaint
terraform untaint ADDRESSRemove taint markOnly if replacement is no longer wanted

Common exam point: Terraform normally plans across the full dependency graph. Targeting is an exception.

Dynamic Blocks and Iteration

resource "aws_security_group" "web" {
  name = "web"

  dynamic "ingress" {
    for_each = var.ingress_rules

    content {
      from_port   = ingress.value.from_port
      to_port     = ingress.value.to_port
      protocol    = ingress.value.protocol
      cidr_blocks = ingress.value.cidr_blocks
    }
  }
}
FeatureBest for
countSimple number of nearly identical instances
for_eachStable instances keyed by names/IDs
dynamic blockRepeating nested blocks inside a resource
for expressionTransforming collections
Splat expressionExtracting attributes from repeated resources

Count vs For_each

QuestionPrefer countPrefer for_each
Are instances identical and only quantity matters?YesNo
Do instances have stable names/keys?NoYes
Could removing one middle element shift indexes?RiskySafer
Address formresource.type.name[0]resource.type.name["key"]
Input shapeNumber or list lengthMap or set of strings

Null, Unknown, and Sensitive Values

Value typeMeaningPlan behavior
nullAbsence/omissionMay let provider default apply
UnknownValue known only after applyDisplayed as known after apply
SensitiveRedacted in CLIStill participates in expressions and may be stored
ComputedProvider returns valueOften unknown until create/read

Files, Directories, and Loading Behavior

BehaviorReference
Terraform loads .tf and .tf.json files in the current directoryFile names are for humans except special variable files
Subdirectories are not automatically includedUse modules to include subdirectories
Root module is the working directoryRunning Terraform from a different directory changes the root module
.terraform/ stores local init dataRegenerated by terraform init
Provider plugins are installed during initSelected versions recorded in lock file

Useful Environment Variables

VariablePurpose
TF_VAR_nameSupplies value for input variable name
TF_LOGEnables Terraform logging for troubleshooting
TF_LOG_PATHWrites logs to file
TF_CLI_ARGSAdds default CLI arguments globally
TF_CLI_ARGS_planAdds default arguments to specific command
TF_INPUTControls interactive prompting
TF_WORKSPACESelects workspace for automation scenarios

Use CLI argument environment variables carefully; hidden defaults can confuse troubleshooting.

Troubleshooting Decision Table

SymptomLikely areaFirst checks
terraform init fails downloading providerProvider source/version/network/authrequired_providers, lock file, registry access, version constraints
Backend init failsBackend configuration/authBackend block, partial config, credentials, state access
Plan wants to recreate renamed resourceAddress changedAdd moved block or use terraform state mv
Plan shows changes you did not codeDrift or provider default changesReview refresh results, remote object, provider version
Data source failsQuery too broad/narrow or credentialsFilter arguments, provider permissions, region/account
Module output unavailableOutput not declared in child moduleAdd child output, reference module.name.output
Aliased provider not usedProvider inheritance/configurationAdd provider = on resource or providers map on module
Workspace applied wrong environmentWorkspace selectionterraform workspace show, backend/workspace settings
Sensitive value printed or storedOutput/state handlingMark outputs sensitive; secure state and plan files
Lock errorConcurrent operation or stale lockConfirm no active run; use backend-supported unlock process carefully

Common Exam Distinctions

Do not confuseCorrect distinction
Provider vs backendProvider manages infrastructure; backend stores state
Resource vs data sourceResource manages; data source reads
Variable vs localVariable is external input; local is internal expression
Output vs stateOutput exposes selected values; state stores managed object data
Module vs workspaceModule organizes/reuses config; workspace separates state
fmt vs validatefmt formats; validate checks configuration
plan vs applyPlan proposes; apply executes
state rm vs destroystate rm forgets; destroy deletes remote object
import vs createImport tracks existing object; create provisions new object
count vs for_eachCount indexes numerically; for_each keys instances
Sensitive output vs secret storageSensitive redacts display, but state still requires protection
Saved plan vs normal applySaved plan applies exact reviewed actions; normal apply creates a new plan

Compact Pre-Exam Checklist

  • Know the default workflow: fmt, init, validate, plan, apply.
  • Know what state is, why it matters, and why it must be protected.
  • Be able to choose between resources, data sources, variables, locals, outputs, modules, and providers.
  • Understand implicit dependencies through references and when depends_on is appropriate.
  • Review count, for_each, dynamic blocks, and address formats.
  • Understand backends, locking, remote state, and workspace separation.
  • Know when to use state mv, state rm, import, moved, -replace, and -target.
  • Review module source formats, version pinning, inputs, outputs, and provider passing.
  • Understand HCP Terraform/Terraform Enterprise workflow concepts: workspaces, remote runs, VCS, variables, private registry, and policy checks.
  • Remember that sensitive values can still exist in state and plan files.

Practical Next Step

After reviewing this Quick Reference, practice with scenario-based questions that ask which Terraform command, block, state operation, module pattern, or HCP Terraform workflow best fits a described situation.