World map

 

BM: Baca dalam Bahasa Melayu

World T4: Modules & Pipelines

Cost checks

You will learn: how a cost check turns a plan into a price change on the pull request.

Checked with OpenTofu 1.13 on 1 Nov 2026

The problem

A one-line change: count = 1 becomes count = 20. The plan says 19 to add. It looks tiny in the diff. Who notices the bill?

Pick one answer.

Try it

Read this plan. Each + is something new to pay for.

Tap what OpenTofu will do to each one.

+ create~ update in place- destroy-/+ replace

0 of 4 read

  1.   # random_pet.stall[1]
      + resource "random_pet" "stall" {
          + id        = (known after apply)
          + length    = 1
          + separator = "-"
        }
    

    What happens to random_pet.stall[1]?

  2.   # random_pet.stall[2]
      + resource "random_pet" "stall" {
          + id        = (known after apply)
          + length    = 1
          + separator = "-"
        }
    

    What happens to random_pet.stall[2]?

  3.   # terraform_data.fridge
      - resource "terraform_data" "fridge" {
          - id     = "1165c449-300a-6d97-cc4b-34a88bc231b8" -> null
          - input  = "old" -> null
          - output = "old" -> null
        }
    

    What happens to terraform_data.fridge?

  4.   # terraform_data.oven
      ~ resource "terraform_data" "oven" {
            id     = "74c5fe3d-c127-5269-3f26-b99320430c9f"
          ~ input  = "small" -> "large"
          ~ output = "small" -> (known after apply)
        }
    

    What happens to terraform_data.oven?

The summary line shows when you finish.

Watch

A cost check: A check that prices the changes in a plan and shows the monthly difference on the pull request. prices each change in the plan. It posts the monthly difference on the pull request. Sort these changes.

Drag a card into a box. Or tap the card, then tap the box.

      Predict

      The cost check says: about RM400 more per month. The team rule: over RM100 needs the boss’s OK. What should happen?

      Pick one answer.

      Check

      Put the pull request checks in order.

      First at the top. Put these in order. Use the arrows, or drag.

      • tofu plan
      • tofu fmt -check and validate
      • A human reviews it all
      • Merge, then apply
      • Policy and cost checks read the plan

      Check

      Swipe: good money habit, or needs work?

      Swipe right for good, left for needs work. Or use the buttons.

      1 / 4

      Tag every resource with an owner, so the bill can be split

      Tag every resource with an owner, so the bill can be split

      You did it!

      You can now see the price of a plan before anyone merges it.

      Go deeper (optional)

      Infracost is a well-known cost tool. It works as a GitHub App, or as a step in CI. It reads the code, looks up public price lists, and comments the monthly change. Usage-based costs, like traffic, need your own guesses. The AWS course (A1) sets up budget alarms.