| Key | Value |
|---|---|
| Services | S3, IAM |
| Integrations | AWS CLI |
| Categories | Security; Multi-Account |
A demo application illustrating how to access S3 resources across different AWS accounts using bucket policies and IAM users with LocalStack. The script uses the following AWS profiles to simulate a cross-account scenario:
- Admin user of account A with account ID
000000000001 - Admin user of account B with account ID
000000000002 - Account A user — creates the S3 bucket and grants cross-account access via bucket policies
- Account B user — copies resources from Account A's
sourcebucket into its owntargetbucket
- A valid LocalStack for AWS license. Your license provides a
LOCALSTACK_AUTH_TOKENto activate LocalStack. - Docker
localstackCLIawslocalCLI- Python 3 with
pip
make checkmake installexport LOCALSTACK_AUTH_TOKEN=<your-auth-token>
make startmake runThe script sets up two AWS accounts with IAM users and bucket policies, then demonstrates cross-account S3 resource access.
This code is available under the Apache 2.0 license.