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.
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.
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
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"
}]
}
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.
- 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.
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 Sharing Specific Objects 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 Sharing Specific Objects
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 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.
- 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.