Skip to content

Use artifacts from S3

dbt-tools can read manifest.json and related artifacts directly from an Amazon S3 bucket. This is common in CI/CD pipelines that upload dbt artifacts after a run.

Minimal example

bash
export DBT_TOOLS_S3_REGION=us-east-1
npx @dbt-tools/cli status \
  --dbt-target s3://my-bucket/dbt/prod/latest \
  --json

Required objects

The S3 prefix must contain:

Object key (relative to prefix)Required
manifest.jsonYes
run_results.jsonYes (for run-related commands)
catalog.jsonNo
sources.jsonNo

For example, if --dbt-target is s3://my-bucket/dbt/prod/latest, dbt-tools reads:

text
s3://my-bucket/dbt/prod/latest/manifest.json
s3://my-bucket/dbt/prod/latest/run_results.json

Environment variables

VariableRequiredDescription
DBT_TOOLS_S3_REGIONYesAWS region of the bucket
DBT_TOOLS_S3_ENDPOINTNoCustom S3-compatible endpoint URL

Standard AWS credential variables also apply: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, and AWS_PROFILE. dbt-tools inherits the standard AWS SDK credential chain.

With a custom endpoint

For S3-compatible storage (MinIO, Ceph, DigitalOcean Spaces, etc.):

bash
export DBT_TOOLS_S3_REGION=us-east-1
export DBT_TOOLS_S3_ENDPOINT=https://s3.example.internal
npx @dbt-tools/cli status \
  --dbt-target s3://my-bucket/dbt/prod/latest \
  --json

With named AWS profile

bash
export AWS_PROFILE=my-read-only-profile
export DBT_TOOLS_S3_REGION=us-east-1
npx @dbt-tools/cli status \
  --dbt-target s3://my-bucket/dbt/prod/latest \
  --json

Grant the IAM role or user used by dbt-tools read-only access to the artifact prefix only:

json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:ListBucket"],
      "Resource": ["arn:aws:s3:::my-bucket", "arn:aws:s3:::my-bucket/dbt/prod/latest/*"]
    }
  ]
}

Do not grant s3:PutObject, s3:DeleteObject, or bucket-level write permissions. dbt-tools only reads artifacts.

Using in GitHub Actions

yaml
- name: Check dbt artifact health from S3
  env:
    AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
    AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
    DBT_TOOLS_S3_REGION: us-east-1
  run: |
    npx @dbt-tools/cli status \
      --dbt-target s3://my-bucket/dbt/prod/latest \
      --json

Troubleshooting

SymptomLikely causeFix
NoSuchKey errorObject does not exist at the prefixConfirm the prefix contains manifest.json
AccessDeniedIAM policy missing s3:GetObject on the prefixReview and update IAM permissions
Auth error in CICredentials not passed to the stepSet AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY as secrets
Slow cold readsLarge artifacts or slow networkConsider caching artifacts as pipeline artifacts rather than re-reading from S3 each time

Released under the repository license terms.