Skip to content

Use EC2 instance role instead of AWS keys - #55

Merged
Akopti8 merged 5 commits into
mainfrom
feature/iam-role-credentials
Oct 15, 2026
Merged

Akopti8 merged 5 commits into
mainfrom
feature/iam-role-credentials

Conversation

@Akopti8

@Akopti8 Akopti8 commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • .env.json can use the EC2 instance role instead of static keys: set "use_iam_role": true (or leave accounts empty). In IAM mode credentials come only from instance metadata; static keys and AWS_* env vars are ignored.
  • New bucket_block_list: blocked buckets are never exposed, even with "*" in the allow list.
  • In IAM mode with named buckets, each is checked with HeadBucket, so the role doesn't need s3:ListAllMyBuckets.
  • MinIO (no longer freely published) replaced by Moto as an opt-in s3mock compose profile.
  • E2E workflow fixed (docker compose v2, s3mock profile).
  • README documents the new config.

Testing

  • E2E suite passes in CI; static-key mode unchanged.
  • Real EC2 instance role, standalone: browse, metadata, content, presigned downloads on ffrd-pilot (cross-account).
  • In FFRD (companion PR Dewberry/ffrd-model-viewer#147): api and s3api ran on the role across 5 buckets; client verified in the browser.

- Updated .example.env to configure S3 mock settings and added access key details.
- Modified .example.env.json to include bucket block list and IAM role usage flag.
- Enhanced BlobHandler to manage blocked buckets and improve AWS credential handling.
- Adjusted bucket listing logic to respect blocked buckets.
- Updated docker-compose.yml to streamline S3 mock service configuration.
@Akopti8
Akopti8 marked this pull request as ready for review October 13, 2026 18:30
@Akopti8 Akopti8 changed the title Use EC2 access rather than AWS keys Use EC2 instance role instead of AWS keys Oct 14, 2026
@Akopti8
Akopti8 merged commit 6aa7740 into main Oct 15, 2026
1 check passed
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