⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All AWS & Cloud Architecture Interview Questions Scenario 123 of 179 in AWS & Cloud Architecture
Senior DevOps / SRE AWS AWS S3 & IAM Security AWS Security

Q: How would you give access to a specific file in an S3 bucket to a user from another organization/account, and what is the difference between S3 Bucket Policy, IAM Policy, and Pre-signed URL?

Architectural decision matrix for sharing specific S3 objects across AWS accounts: evaluating Resource-based Bucket Policies, Identity-based IAM Policies, and temporary Pre-signed URLs.

#AWS #S3 #IAM #Security #Cross-Account #Comparisons
🎙️ Candidate Opening & Architectural Context
"Access to S3 objects cross-account can be achieved via three distinct mechanisms depending on whether the requester is authenticated within an external AWS account or is an anonymous third-party user needing temporary access."
Advertisement
⚡ Recommended Practice Lab

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: Access to S3 objects cross-account can be achieved via three distinct mechanisms depending on whether the requester is authenticated within an external AWS account or is an anonymous third-party user needing temporary access.

1

Mechanism 1: Pre-signed URL (Best for Temporary Access)

If a user from another company needs temporary access to download a specific file without needing an AWS IAM identity, generate a pre-signed URL with an explicit expiration window.

aws s3 presign s3://company-reports/audit-2026.pdf --expires-in 3600
2

Mechanism 2: S3 Bucket Policy (Cross-Account AWS Identity)

Add an explicit Bucket Policy in the resource account granting s3:GetObject on the specific ARN to the external account's Principal ARN.

{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Principal": {"AWS": "arn:aws:iam::111122223333:role/ExternalAuditorRole"},
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::company-reports/audit-2026.pdf"
  }]
}
Advertisement
3

Comparison Summary

IAM Policies: applied to users/roles within your own account. Bucket Policies: applied to the S3 bucket to allow external principals. Pre-signed URLs: time-bounded bearer tokens for anyone with the URL.

💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pre-signed URLs are best for temporary non-AWS users. S3 Bucket Policies grant programmatic access to external AWS Principal ARNs on exact object prefixes."
⚡ 60-Second Elevator Pitch Talking Points
  • Pre-signed URLs: generate temporary, signed URLs (up to 7 days) without requiring AWS accounts.
  • Bucket Policy: specify the external AWS account Principal ARN with s3:GetObject on the exact object key ARN.
  • IAM Policy: must be paired with bucket policy so the external user has permission in their own account.
  • Verify S3 Block Public Access and KMS key permissions if the bucket is encrypted with SSE-KMS.
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Relying on legacy bucket ACLs instead of modern S3 Block Public Access and IAM bucket policies when configuring Sharing Specific Objects AWS recommends disabling ACLs (Bucket Owner Enforced) in favor of centralized declarative bucket policies and account-level Block Public Access controls.
  2. Confusing SSE-S3 encryption with KMS customer-managed key (SSE-KMS) authorization policies when configuring Sharing Specific Objects Accessing SSE-KMS encrypted objects requires both s3:GetObject and kms:Decrypt permissions; neglecting KMS key policies causes silent 403 Forbidden errors.
  3. Using sequential timestamps or predictable prefixes for high-throughput S3 read and write keys when configuring Sharing Specific Objects 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.
  4. Failing to audit S3 object delete markers when troubleshooting missing versioned objects when configuring Sharing Specific Objects Issuing a DELETE on a versioned bucket only adds a delete marker; engineers must retrieve previous versions or purge markers to restore data.
Advertisement
Want more AWS & Cloud Architecture scenarios?
Explore our complete collection of scenario-based AWS & Cloud Architecture interview runbooks.
Browse All AWS & Cloud Architecture Questions →