Skip to content

Do not resolve params of irrelevant stages - #425

Open
mnapoli wants to merge 2 commits into
4.xfrom
defer-irrelevant-stage-params
Open

Do not resolve params of irrelevant stages#425
mnapoli wants to merge 2 commits into
4.xfrom
defer-irrelevant-stage-params

Conversation

@mnapoli

@mnapoli mnapoli commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Variables in params.<stage> sections are now only resolved for the effective stage (and default). Params of other stages are left untouched: their sources are not invoked (no wasted SSM/remote calls) and their errors (unknown sources, missing env vars, etc.) no longer fail the command.

Explicit references like ${self:params.prod.domain} still resolve the targeted property on demand, exactly as before. Variable syntax errors are still reported for all stages.

Known limitation: when the whole params object comes from a single variable (e.g. params: ${file(./params.yml)}), its content is discovered mid-pass and resolved eagerly as before.

Deferring params of irrelevant stages also deferred sections configured
with a single variable (e.g. `params.prod: ${file(./prod-params.yml)}`).
Such a section was then left as a raw string in the configuration, and
failed validation with `Configuration error at 'params.prod': must be
object`.

Also skip deferral entirely while the effective stage is not known yet
(`provider.stage` configured behind a variable which did not resolve).
Deferring against a stage which is about to change could otherwise leave
params of the effective stage never scheduled for resolution.

Claude-Session: https://claude.ai/code/session_01KjRVxH8vbJpzfQMsMD2nTg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant