How to grant cross account S3 bucket access

Arun Kumar
Cloud Techies
2 min readJan 7, 2021

--

General Policy

  • IAM Role + assume role is always preferred over access keys (if third party is on Amazon and their app can assumerole).
  • Access keys have to be rotated for best security practices, and they are harder to control/contain.

Approach

Assume you had access key on Account A.

You want access to a bucket on Account B

Assume Account B bucket=sample-logs, add the following into its Bucket Policy.

Then on Account A, update user IAM inline policy with the below.

Setting up IAM Users, Roles and bucket policy

If you need access keys, you need an IAM User + policy.

If a third party can assume role, you just need the role with sts:AssumeRole allowed for that account. You also need to update the s3 bucket policy to allow access from that account.

--

--

Arun Kumar
Cloud Techies

Cloud Architect | AWS, GCP, Azure, Python, Kubernetes, Terraform, Ansible