Library /
Rule
Cost gate
A scheduling rule that blocks a Dataform run when its BigQuery dry-run estimate is above 5 US dollars.
Use it when You want a rebuild to run on new data, but never at a surprising price.
- name: Rebuild acme-dwh when a source changes
priority: 3
status: active
code_id: dwh/acme-source-change
applies_to:
node_type: DataformAction
tags:
- dwh_rebuild
when:
events:
- origin: ancestors
types: data_updated
ancestor_depth: direct
wait_for_all_ancestors: true
if:
quiet_period_seconds: 300
max_estimated_cost_usd: 5
then:
target:
same_as_applies_to: true
scope: node
do:
kind: single
action:
type: dataform_run
parameters:
release: projects/acme-data-prod/locations/europe-west1/repositories/acme-dwh/releaseConfigs/daily
Taken from docs/integrations/google-cloud.md
max_estimated_cost_usd is a per-run gate on the dry-run cost estimate. Nistor estimates the cost first, and blocks
the run, recorded as failed, when the estimate is above the limit.
dataform_run is the only executor that can dry-run its SQL, so only Dataform runs have an estimate. For the other
executors the limit has nothing to estimate. To cap spend over a period instead, a rule has cost_limit.
Feeds fromGoogle Cloud