Skip to content

002 · Domain 7: HCP Terraform / Enterprise Operations · 12% of the exam

Task 7.2: Track resource usage and cost

Knowing what an organization runs and spends: managed resource counts, cost estimation in the run, explorer, and the tfe provider's organization data.

Study it

Sample questions

Try each one before opening the answer. Every option is explained, with the HashiCorp documentation page that proves it.

Question 1 · choose 1

A workspace's configuration contains: resource "aws_instance" "web" { count = 10 } data "aws_ami" "base" { ... } data "aws_vpc" "main" { ... } module "logs" { source = "./logs" # inside: one aws_s3_bucket, and aws_s3_bucket_policy with # for_each over three keys } After a successful apply, how many managed resources does this workspace add to the organization's usage count?

  1. A14: the ten instances plus the four resources in the module
  2. B4, one per resource block
  3. C16, with the two data sources counted as well
  4. D11, with the module's resources counted once per module call
Show the answer and why
  • A14: the ten instances plus the four resources in the module

    Correct

    Every managed resource instance counts, including those in modules and those created by count or for_each; data sources do not.

  • B4, one per resource block

    Incorrect

    Each instance created by count or for_each is counted separately.

  • C16, with the two data sources counted as well

    Incorrect

    Resources whose mode is data are excluded from the managed resource count.

  • D11, with the module's resources counted once per module call

    Incorrect

    Resources in modules count like any other managed resource instance.

HCP Terraform reads state and counts every instance whose mode is managed, so count and for_each multiply the count while data sources add nothing.

Question 2 · choose 1

A new HCP Terraform organization sees no cost estimates in its runs. Why?

  1. AEstimates appear only after a month of runs
  2. BEach workspace must install a separate cost provider
  3. CCost estimation is off by default for organizations
  4. DEstimates need Premium edition agents
Show the answer and why
  • AEstimates appear only after a month of runs

    Incorrect

    Estimates appear in every run once enabled.

  • BEach workspace must install a separate cost provider

    Incorrect

    No provider is involved.

  • CCost estimation is off by default for organizations

    Correct

    HCP Terraform disables cost estimation by default; an organization setting enables it for all workspaces.

  • DEstimates need Premium edition agents

    Incorrect

    No agent requirement is documented.

Enable it under Settings, then Cost Estimation, in the organization.

Question 3 · choose 1

With cost estimation enabled, where in a run do estimates appear?

  1. AAs an extra run phase between plan and apply
  2. BAfter apply, in the state file
  3. CBefore plan, estimated from the configuration alone
  4. DOnly in a monthly report
Show the answer and why
  • AAs an extra run phase between plan and apply

    Correct

    HCP Terraform performs a cost estimate for every run and shows it as an extra phase between plan and apply.

  • BAfter apply, in the state file

    Incorrect

    Estimates are not stored in state.

  • CBefore plan, estimated from the configuration alone

    Incorrect

    Estimates follow the plan.

  • DOnly in a monthly report

    Incorrect

    They appear in each run's UI.

The phase shows a monthly total that can be expanded into itemized costs.

Question 4 · choose 1

A cost estimate lists several resources as unestimated. What is the most likely reason?

  1. ACost estimation is disabled for those workspaces
  2. BThe resources use for_each
  3. CThe plan was speculative
  4. DThey lack cost data or have usage-based pricing
Show the answer and why
  • ACost estimation is disabled for those workspaces

    Incorrect

    Other resources in the same run were estimated.

  • BThe resources use for_each

    Incorrect

    Meta-arguments do not block estimates.

  • CThe plan was speculative

    Incorrect

    Speculative plans can be estimated too.

  • DThey lack cost data or have usage-based pricing

    Correct

    Some resources have no cost information or unpredictable usage-based pricing, and only supported resources are estimated.

Supported resources come from three major cloud providers and are listed in the cost estimation documentation.

Question 5 · choose 1

A finance reviewer asks what each resource line in an HCP Terraform cost estimate shows. What is the answer?

  1. AOnly the total for the whole run, never per resource
  2. BHourly and monthly cost, plus the monthly delta
  3. CYearly cost with reserved pricing
  4. DThe cost of the last apply only
Show the answer and why
  • AOnly the total for the whole run, never per resource

    Incorrect

    Resources are itemized as well.

  • BHourly and monthly cost, plus the monthly delta

    Correct

    Each resource shows an hourly and monthly cost along with the monthly delta, and totals are shown too.

  • CYearly cost with reserved pricing

    Incorrect

    Estimates are hourly and monthly.

  • DThe cost of the last apply only

    Incorrect

    Estimates describe the planned change.

The monthly delta shows how much a change adds or removes.

Practice domain 7 →Practice all domains →