Repository navigation
fix(infra): re-baseline the cost budgets above the measured floor - #1098
Merged
Merged
Conversation
The $300/$600 ladder was set at bootstrap. Measured steady state is now $23.08/day (2026-11-10..15, Cost Explorer daily unblended) = ~$702/month, so the upper tier fired on ordinary operation and stopped carrying information. New ladder is $800 watch / $1000 alarm. Names go from amount-bearing to role-bearing, so the amount lives only in limit_amount and the next re-baseline cannot leave a misleading name behind. That is a destroy+create of two budgets, which carry no data. Closes #1095 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
terraform plan
Warning This plan DESTROYS resources in: core. Merging applies it unattended. core — 2 to add, 0 to change, 2 to DESTROYmodule.identity_center.data.aws_ssoadmin_instances.this: Reading...
data.aws_iam_policy_document.ci_tf_plan_state: Reading...
data.aws_iam_policy_document.ci_tf_plan_state: Read complete after 0s [id=2883378100]
data.aws_caller_identity.current: Reading...
data.aws_iam_policy_document.ci_tf_drift_refresh: Reading...
data.aws_iam_policy_document.ci_tf_drift_refresh: Read complete after 0s [id=2350222434]
data.aws_iam_policy_document.obs_pod_trust: Reading...
data.aws_iam_policy_document.obs_pod_trust: Read complete after 0s [id=819195744]
data.aws_iam_policy_document.ci_tf_apply_no_prod_state: Reading...
data.aws_caller_identity.current: Read complete after 0s [id=797781631727]
module.github_oidc.data.aws_iam_policy_document.trust: Reading...
data.aws_iam_policy_document.ci_tf_apply_no_prod_state: Read complete after 0s [id=2395007408]
module.github_oidc.data.aws_iam_policy_document.trust: Read complete after 0s [id=4060172364]
data.aws_iam_policy_document.config_bucket: Reading...
data.aws_iam_policy_document.cur_delivery: Reading...
module.github_oidc.data.aws_iam_policy_document.push: Reading...
data.aws_iam_policy_document.cur_delivery: Read complete after 0s [id=2207400467]
data.aws_iam_policy_document.sccache_write: Reading...
data.aws_iam_policy_document.sccache_write: Read complete after 0s [id=786296009]
module.github_oidc.data.aws_iam_policy_document.push: Read complete after 0s [id=2177873069]
data.aws_iam_policy_document.sccache_read: Reading...
data.aws_iam_policy_document.config_bucket: Read complete after 0s [id=4067691321]
data.aws_iam_policy_document.sccache_trust_write: Reading...
data.aws_iam_policy_document.sccache_read: Read complete after 0s [id=2701062528]
data.aws_iam_policy_document.sccache_trust_read: Reading...
data.aws_iam_policy_document.ci_tf_apply_trust: Reading...
data.aws_iam_policy_document.ci_tf_plan_trust: Reading...
data.aws_iam_policy_document.ci_tf_drift_trust: Reading...
data.aws_iam_policy_document.sccache_trust_write: Read complete after 0s [id=4060172364]
data.aws_iam_policy_document.ci_tf_apply_trust: Read complete after 0s [id=2538345208]
data.aws_iam_policy_document.sccache_trust_read: Read complete after 0s [id=1630650595]
data.aws_iam_policy_document.ci_tf_plan_trust: Read complete after 0s [id=1630650595]
data.aws_iam_policy_document.ci_tf_drift_trust: Read complete after 0s [id=3359896184]
data.aws_iam_policy_document.openobserve: Reading...
data.aws_iam_policy_document.audit_bucket: Reading...
data.aws_iam_policy_document.openobserve: Read complete after 0s [id=2662704728]
data.aws_iam_policy_document.audit_bucket: Read complete after 0s [id=3031279952]
module.identity_center.data.aws_ssoadmin_instances.this: Read complete after 0s [id=us-east-2]
data.aws_iam_policy_document.ci_tf_apply_prod_trust: Reading...
data.aws_iam_policy_document.ci_tf_apply_prod_trust: Read complete after 0s [id=3513372776]
module.identity_center.data.aws_identitystore_user.admin: Reading...
module.identity_center.data.aws_identitystore_user.admin: Read complete after 1s [id=b17b2500-e0b1-7046-405b-23c088cf392b]
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
+ create
- destroy
Terraform will perform the following actions:
# aws_budgets_budget.monthly_300 will be destroyed
# (because aws_budgets_budget.monthly_300 is not in configuration)
- resource "aws_budgets_budget" "monthly_300" {
- account_id = "797781631727" -> null
- arn = "arn:aws:budgets::797781631727:budget/er-monthly-300" -> null
- budget_type = "COST" -> null
- id = "797781631727:er-monthly-300" -> null
- limit_amount = "300.0" -> null
- limit_unit = "USD" -> null
- metrics = [] -> null
- name = "er-monthly-300" -> null
- tags = {} -> null
- tags_all = {
- "Environment" = "core"
- "ManagedBy" = "terraform"
- "Project" = "entity-resolution"
} -> null
- time_period_end = "2087-06-15_00:00" -> null
- time_period_start = "2026-10-01_00:00" -> null
- time_unit = "MONTHLY" -> null
# (2 unchanged attributes hidden)
- cost_types {
- include_credit = true -> null
- include_discount = true -> null
- include_other_subscription = true -> null
- include_recurring = true -> null
- include_refund = true -> null
- include_subscription = true -> null
- include_support = true -> null
- include_tax = true -> null
- include_upfront = true -> null
- use_amortized = false -> null
- use_blended = false -> null
}
- notification {
- comparison_operator = "GREATER_THAN" -> null
- notification_type = "ACTUAL" -> null
- subscriber_email_addresses = [
- "[email protected]",
] -> null
- subscriber_sns_topic_arns = [] -> null
- threshold = 100 -> null
- threshold_type = "PERCENTAGE" -> null
}
- notification {
- comparison_operator = "GREATER_THAN" -> null
- notification_type = "FORECASTED" -> null
- subscriber_email_addresses = [
- "[email protected]",
] -> null
- subscriber_sns_topic_arns = [] -> null
- threshold = 100 -> null
- threshold_type = "PERCENTAGE" -> null
}
}
# aws_budgets_budget.monthly_600 will be destroyed
# (because aws_budgets_budget.monthly_600 is not in configuration)
- resource "aws_budgets_budget" "monthly_600" {
- account_id = "797781631727" -> null
- arn = "arn:aws:budgets::797781631727:budget/er-monthly-600" -> null
- budget_type = "COST" -> null
- id = "797781631727:er-monthly-600" -> null
- limit_amount = "600.0" -> null
- limit_unit = "USD" -> null
- metrics = [] -> null
- name = "er-monthly-600" -> null
- tags = {} -> null
- tags_all = {
- "Environment" = "core"
- "ManagedBy" = "terraform"
- "Project" = "entity-resolution"
} -> null
- time_period_end = "2087-06-15_00:00" -> null
- time_period_start = "2026-10-01_00:00" -> null
- time_unit = "MONTHLY" -> null
# (2 unchanged attributes hidden)
- cost_types {
- include_credit = true -> null
- include_discount = true -> null
- include_other_subscription = true -> null
- include_recurring = true -> null
- include_refund = true -> null
- include_subscription = true -> null
- include_support = true -> null
- include_tax = true -> null
- include_upfront = true -> null
- use_amortized = false -> null
- use_blended = false -> null
}
- notification {
- comparison_operator = "GREATER_THAN" -> null
- notification_type = "ACTUAL" -> null
- subscriber_email_addresses = [
- "[email protected]",
] -> null
- subscriber_sns_topic_arns = [] -> null
- threshold = 100 -> null
- threshold_type = "PERCENTAGE" -> null
}
- notification {
- comparison_operator = "GREATER_THAN" -> null
- notification_type = "FORECASTED" -> null
- subscriber_email_addresses = [
- "[email protected]",
] -> null
- subscriber_sns_topic_arns = [] -> null
- threshold = 100 -> null
- threshold_type = "PERCENTAGE" -> null
}
}
# aws_budgets_budget.monthly_alarm will be created
+ resource "aws_budgets_budget" "monthly_alarm" {
+ account_id = (known after apply)
+ arn = (known after apply)
+ budget_type = "COST"
+ id = (known after apply)
+ limit_amount = "1000.0"
+ limit_unit = "USD"
+ name = "er-monthly-alarm"
+ name_prefix = (known after apply)
+ tags_all = {
+ "Environment" = "core"
+ "ManagedBy" = "terraform"
+ "Project" = "entity-resolution"
}
+ time_period_end = "2087-06-15_00:00"
+ time_period_start = (known after apply)
+ time_unit = "MONTHLY"
+ cost_filter (known after apply)
+ cost_types (known after apply)
+ notification {
+ comparison_operator = "GREATER_THAN"
+ notification_type = "ACTUAL"
+ subscriber_email_addresses = [
+ "[email protected]",
]
+ subscriber_sns_topic_arns = []
+ threshold = 100
+ threshold_type = "PERCENTAGE"
}
+ notification {
+ comparison_operator = "GREATER_THAN"
+ notification_type = "FORECASTED"
+ subscriber_email_addresses = [
+ "[email protected]",
]
+ subscriber_sns_topic_arns = []
+ threshold = 100
+ threshold_type = "PERCENTAGE"
}
}
# aws_budgets_budget.monthly_watch will be created
+ resource "aws_budgets_budget" "monthly_watch" {
+ account_id = (known after apply)
+ arn = (known after apply)
+ budget_type = "COST"
+ id = (known after apply)
+ limit_amount = "800.0"
+ limit_unit = "USD"
+ name = "er-monthly-watch"
+ name_prefix = (known after apply)
+ tags_all = {
+ "Environment" = "core"
+ "ManagedBy" = "terraform"
+ "Project" = "entity-resolution"
}
+ time_period_end = "2087-06-15_00:00"
+ time_period_start = (known after apply)
+ time_unit = "MONTHLY"
+ cost_filter (known after apply)
+ cost_types (known after apply)
+ notification {
+ comparison_operator = "GREATER_THAN"
+ notification_type = "ACTUAL"
+ subscriber_email_addresses = [
+ "[email protected]",
]
+ subscriber_sns_topic_arns = []
+ threshold = 100
+ threshold_type = "PERCENTAGE"
}
+ notification {
+ comparison_operator = "GREATER_THAN"
+ notification_type = "FORECASTED"
+ subscriber_email_addresses = [
+ "[email protected]",
]
+ subscriber_sns_topic_arns = []
+ threshold = 100
+ threshold_type = "PERCENTAGE"
}
}
Plan: 2 to add, 0 to change, 2 to destroy.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1095
What
Re-baselines the two cost budgets from
$300/$600to$800watch /$1000alarm, and renames them from amount-bearing (er-monthly-300) torole-bearing (
er-monthly-watch,er-monthly-alarm).Why
Measured steady state is $23.08/day → ~$702/month, so the old upper tier
fired on ordinary operation and stopped carrying information. The rename is so
the amount lives only in
limit_amount; the old names went stale the moment thefloor moved.
Proof
terraform fmt -check -recursiveclean,terraform validateSuccess inenvs/core, andmake tf-static-credentials-checkpassed (9/9 self-tests, thenclean — 1 access key(s), all allowed). Terraform-only diff, so the Rust andfrontend gates have nothing to compile;
infra.yml's plan job on this PR is thereal gate.
Risk & rollback
Renaming the resources is a destroy+create of two
aws_budgets_budgetresources, which hold no data — the plan should show 2 destroys and 2 creates
and nothing else. Rollback is
git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:f14bf995-5565-41eb-9658-d3746dc3188eonMac-833· 2026-11-17T02:59:51Zmainis green with this change on it — merge SHA2b9f9d7d5861da0ce0dbe98cac134b972983303a. 40 check-runs on that SHA,zero non-success/non-skipped, including
test,workflow pins (S9),playwright functional tier,terraform plan,agent skillsand all fourplan legs. infra run
44006226008concludedsuccess.images—n/a— the diff is one Terraform file inenvs/core; nothingthat goes into an image changed, and
detect changescorrectly skipped theimage path.
deploy—n/a— no deployable artifact changed. Budgets are an AWSAPI object applied by
infra.yml, not something the cluster serves.that mattered here, since the apply only exists on push:
apply (core),apply (dev)andapply (prod)all concludedsuccesson the merge SHA.Donethrough the automation rather than byhand, and the issue closed: Re-baseline the AWS cost budgets above the measured floor #1095 reads
state=CLOSED reason=COMPLETED,card
Done. Not touched by hand.60 GiB of detached gp3 still needs a
kubectlcheck to tell retainedPVC data from reclaimable waste. Nothing else is owed.
~$320/month two-environment floor and the NAT no-lever result with its
three closed paths are recorded on November 2026 cost review: findings, and why NAT Gateway has no lever #1097 so they are not re-investigated,
and in session memory (
november-2026-cost-review).Specific to this change
infra.yml's apply onmainactually recreated both budgets — readback live, not inferred from the apply conclusion:
aws budgets describe-budgets --account-id 797781631727 \ --query 'Budgets[].[BudgetName,BudgetLimit.Amount]' er-monthly-alarm 1000.0 er-monthly-watch 800.0The
er-monthly-300/er-monthly-600pair is gone; only the tworole-named budgets remain.
assumed, because a budget with no subscriber looks identical to a working
one. Both budgets carry
ACTUAL 100.0andFORECASTED 100.0, anddescribe-subscribers-for-notificationreturnsEMAIL [email protected]on each.Context — plan, discoveries, measurements, files
Plan
Discoveries
budgets.tfreferences the budget names, so the rename isfree (
grep -rn 'er-monthly-300|monthly_300'hits only the file itself andother worktrees' copies).
through SNS, so there is no fan-out to re-point.
Measurements
Cost Explorer daily unblended,
--group-by Type=DIMENSION,Key=SERVICE, over2026-11-01..17. Post-prod-launch steady state:Mean $23.08/day →
$702/month.$96), 2 NAT$320/month of that is fixed two-environment$146), 2 Auto Mode system nodes (cost: 2 EKS control planes (
gateways (
$64), 5 public IPv4 ($18).November is a bad window to re-measure from: $228.76 of MTD was one-off S3
egress from sccache, which ended 11-09 when the cache moved to R2 (#920). Full
breakdown and the NAT no-lever result are recorded in #1097.
Files
infra/terraform/envs/core/budgets.tf