Q: You need to give a third-party vendor access to a specific S3 bucket without giving them AWS credentials. How?
Use IAM Cross-Account Role Assumption:
Want to master this scenario in a live sandbox? Stephane Maarek's AWS Certified DevOps Engineer Professional Masterclass on Udemy covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "When an interviewer asks how I troubleshoot this in AWS, I frame it through my hands-on production experience. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix."
Initial Diagnostics & Root Cause Analysis
Use IAM Cross-Account Role Assumption:
- In your AWS account, create an IAM role with S3 permissions on the bucket.
- Set the trust policy to allow the vendor's AWS account ID to assume the role.
- The vendor calls
sts:AssumeRolefrom their account and gets temporary credentials. - They use those credentials to access only what the role allows.
Remediation & Permanent Safeguards
Benefits: Alternatively for simpler cases: create an IAM user with programmatic access (access key/secret) scoped only to that bucket. Less ideal — long-term credentials.
- No long-term credentials shared.
- You can revoke access instantly by deleting the role.
- All access is auditable in CloudTrail.
- In your AWS account, create an IAM role with S3 permissions on the bucket.
- Set the trust policy to allow the vendor's AWS account ID to assume the role.
- The vendor calls sts:AssumeRole from their account and gets temporary credentials.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Relying on legacy bucket ACLs instead of modern S3 Block Public Access and IAM bucket policies when configuring need give third AWS recommends disabling ACLs (Bucket Owner Enforced) in favor of centralized declarative bucket policies and account-level Block Public Access controls.
-
Confusing SSE-S3 encryption with KMS customer-managed key (SSE-KMS) authorization policies when configuring need give third
Accessing SSE-KMS encrypted objects requires both
s3:GetObjectandkms:Decryptpermissions; neglecting KMS key policies causes silent 403 Forbidden errors. - Using sequential timestamps or predictable prefixes for high-throughput S3 read and write keys when configuring need give third Sequential key prefixes limit S3 horizontal partitioning; randomized hash prefixes distribute workloads across partitions to achieve 3,500 PUT and 5,500 GET requests/sec.
- Failing to audit S3 object delete markers when troubleshooting missing versioned objects when configuring need give third Issuing a DELETE on a versioned bucket only adds a delete marker; engineers must retrieve previous versions or purge markers to restore data.