The load balancer failed at midnight. Traffic kept coming. S3 held the data like a vault, but every request was throttled to a crawl. The fix wasn’t about speed. It was about trust, security, and the right IAM roles.
When you run AWS S3 behind a load balancer, read-only roles are your weapon. They protect your buckets while serving millions of requests without choking on permissions. It’s not enough to just point an ELB or ALB at an endpoint. You have to bind every instance, container, or Lambda to a precise read-only IAM role, and design it so the load balancer fans out traffic to workers that can fetch exactly what they need—no more, no less.
Step one: Create a dedicated IAM policy for read-only S3 access. Keep it tight. Limit to specific buckets and paths, and enable logging. Use s3:GetObject and s3:ListBucket only. Avoid wildcard permissions.
Step two: Attach the role to every compute resource in the target group. This ensures that whether requests hit EC2, ECS, or Lambda, the job gets done without exposing write privileges.