Skip to main content

Describe Every Stack Without Credentials for Every Account

· 3 min read
thejrose1984
Community Contributor

In a multi-account repository, each stage keeps its Terraform state in its own account. Describing the whole repository means reading all of that state, and one bucket your credentials cannot open was enough to abort the entire run with a raw AccessDenied. Now a value Atmos is not allowed to read shows up as (computed), and the rest of the describe finishes.

The Problem​

Running atmos describe stacks without --stack evaluates every YAML function in every component of every stack. When a component in one account reads another account's state with !terraform.state, the read only works if some identity in your environment can open that account's state bucket.

When none can, for example because you only operate one account or an identity is not declared for that stack, the command stopped at the first refusal:

Terminal
Error: failed to read Terraform state for component `global` in stack `dev`
operation error S3: GetObject, StatusCode: 403, api error AccessDenied

The default --error-mode=warn already showed state that does not exist yet as (computed). It did not do the same for state that exists but cannot be read, so the command failed even in its most lenient mode.

The Fix​

When the backend refuses the read, --error-mode=warn (the default) now records the value as (computed), lists it in the end-of-command summary, and keeps going. silent does the same without the summary. strict still fails, and the error now suggests how to scope or skip the reads.

Only access failures from S3 and Azure state backends are degraded:

  • the backend answers access denied (HTTP 403), including a refused role assumption;
  • the AWS credentials are expired or invalid, or empty static credentials were supplied;
  • the AWS profile the backend names is not configured on this machine.

A 403 from a GCS state backend still fails, and so does an AWS credential chain that finds no credentials at all (for example, "no EC2 IMDS role found").

Everything else still fails in every mode, because a (computed) value would hide a real mistake: a misspelled or unsupported backend, a wrong region, throttling, network errors, a corrupt state file, or a static remote-state backend that does not declare the output being read.

Atmos also stops retrying an S3 read that was refused. Before, each unreadable stack added several seconds of backoff to the run.

How to Use It​

Nothing to configure. A !terraform.state read authenticates with the target stack's own default identity, so a repository where every stack declares its identity resolves those values normally. Degradation applies only when your environment cannot read the backend at all.

To fail instead, pass --error-mode=strict. To skip these reads entirely, pass --skip=terraform.state or --process-functions=false.

This changes what an existing command does: a run that used to fail can now exit 0. Projects whose edition is pinned before 2026-12-02 keep the old behavior until they move the pin.

Get Involved​

Questions or feedback? Join the discussion in issue #2566 or in the Cloud Posse Slack.