Skip to content

Decide: should estimate <plan.json> price the full post-apply fleet or only changed resources? #51

Description

@andreacappelletti97

Splitting this out of the PR #46 review so the decision is explicit before merge.

Background

Today's plan parser reads only resource_changes and filters no-op actions, so c3x estimate plan.json returns roughly the cost of what this apply changes (near-$0 for a plan where most resources are unchanged). #46 rewrites it to walk planned_values (the full post-apply resource set), so estimate plan.json returns the total cost of all resulting infrastructure.

Why it needs a decision

Changing the default output of estimate plan.json is a behavior change for existing users:

  • --budget gates can flip: a plan that added one $10/mo resource used to total ~$10; now it totals the whole fleet (hundreds/mo), which may fail a CI budget that previously passed.
  • --format json payload changes shape (all resources + full-fleet project_total instead of the changed subset).
  • The --show-delta flag added in Improve plan parser completeness and support optional() type defaults #46 gives the changed-only view on demand.

Options

  1. Adopt full-fleet as the default (what Improve plan parser completeness and support optional() type defaults #46 does). Rationale: estimate should report the cost of the infrastructure the source describes; the old changed-only total was arguably misleadingly low. Use --show-delta for the change view. Requires a clear CHANGELOG/README note and a heads-up for --budget users.
  2. Keep changed-only as the default, make full-fleet opt-in.
  3. Add a flag to select the mode explicitly.

Recommendation

Option 1, with an explicit CHANGELOG entry and a note in the estimate docs, since it matches the meaning of estimate elsewhere in the tool. Tracking here so it's a conscious call rather than an implicit side effect of #46.

Refs #46.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions