Repository navigation
Description
What happens
On a multi-region project, chant lifecycle snapshot <env> only captures the stacks that live in the ambient region. Every other stack fails with:
aws: no valid resources or artifacts returned
Reproduced against a 4-stack, 3-region estate (us-east-1 ×2, us-west-1, us-west-2) on the Floci emulator with AWS_DEFAULT_REGION=us-east-1:
ec2-multiregion-EC2-ks84v1fh12-us-east-1: Snapshot saved to chant/lifecycle (aws(17))
error: aws: no valid resources or artifacts returned
error: aws: no valid resources or artifacts returned
ec2-multiregion-QARoles-us-east-1: Snapshot saved to chant/lifecycle (aws(4))
Two of four stacks recorded. chant lifecycle show then reports a partial estate, and a subsequent diff would read the missing stacks as absent rather than unobserved.
Cause
config.stacks[].region is dropped on the way to the plugin.
resolveStackTargets(cli/handlers/lifecycle.ts) mapsconfig.stacksto{ stack: s.name, root: resolve(s.src) }, discardings.region.takeSnapshot(lifecycle/snapshot.ts) has noregionin its options and callsplugin.describeResources({ environment, buildOutput, entityNames, entities, stack }).- The AWS plugin already supports it —
describeResources,exportResourcesandlistArtifactsall takeregion?: stringand buildregionArgs, with the comment "Multi-region estates: target this stack's region, not the ambient one." It simply never receives one.
So the plugin falls back to the ambient region and describe-stack-resources finds nothing for out-of-region stacks.
chant search --live is unaffected because cli/handlers/search.ts maps config.stacks to { name, region, src } and passes regions through. The same estate returns all six instances across all three regions via search --live.
Suggested fix
Thread the declared region the way search already does:
StackTargetgainsregion?: string, andresolveStackTargetscarriess.region.takeSnapshot's options gainregion?: string, forwarded todescribeResourcesandlistArtifacts.- The snapshot call site passes
{ stack: target.stack, region: target.region }.
Also worth checking
runLifecycleDiffLive is reached from the same resolveStackTargets loop and is passed only stack: target.stack, so lifecycle diff is likely the same shape. observeResources already accepts stacks: Array<{ name, region, src }>, so the plumbing exists there too.
Impact
Any multi-region project. The snapshot is silently partial: it exits having written some stacks, so the failure reads as a per-stack quirk rather than a systematic region miss.
Activity
fix(lifecycle): snapshot a stack in the region it declares (#1262)
fix(aws): an endpoint override carries its region (#1429)
fix(core): lifecycle diff forwards each stack's region to the live re…
fix(lifecycle): snapshot a stack in the region it declares (INTENTIUS…