Set one retry policy for a whole stack
Component retry already recovers a single component from a transient error: a 502, a dropped registry connection, a flaky provider lookup. The hard part was sharing that same policy across every component in a stack. You'd copy the same retry: block onto each component, wire up a shared abstract base component just to hold it, or set up a mixin. Now you can define the policy once at the stack level, and every component in that stack inherits it automatically.
The Problem
Component retry matches transient failures against conditions regex patterns and retries with backoff. That mechanism works well for one component. Restructuring unrelated components to share an abstract base just so they inherit a policy, or setting up a mixin file with overrides.retry and importing it everywhere, gets you there too — but none of those match the real goal: every component in this stack should recover the same way, without extra plumbing.
The Fix
Stacks now accept a top-level retry: block. This works the same way as the existing top-level vars, metadata, and hooks blocks. Set it once at the root of a stack manifest. Every supported component in that stack then picks it up:
retry:
max_attempts: 5
backoff_strategy: exponential
initial_delay: 2s
max_delay: 30s
conditions:
- /Bad Gateway/
- /GOAWAY/
- /could not query provider registry/
components:
terraform:
vpc:
# ...
transit-gateway:
# ...
A concrete component's retry: overrides stack and abstract-base values for keys it sets. Missing keys inherit from lower-precedence layers. The full precedence order, lowest to highest, is: stack-level default → abstract base component → concrete component → overrides.retry.
How to Use It
Add retry: to the root of any stack manifest, alongside vars: and components:. You need no mixin file, no shared base component, and no per-component copies:
retry:
max_attempts: 3
conditions:
- /Bad Gateway/
- /connection reset/
components:
terraform:
vpc:
vars:
name: vpc
rds:
vars:
name: rds
Both vpc and rds retry on the same conditions without either one declaring retry: itself. If one component needs a different policy, set retry: directly on that component. Its values override lower-precedence layers unless overrides.retry sets the same keys. Missing keys continue through the precedence chain.
The mixin pattern from the component retry docs is still the right tool for a policy that applies to only part of a stack.
Get Involved
Open a discussion in the Atmos repo or post in the SweetOps Slack. Let us know if you hit a retry scenario that the current scoping (stack, base component, component, overrides) doesn't cover well.
