- Newest
- Most votes
- Most comments
The key difference between your CLI and console export attempts is that when exporting DynamoDB data to an S3 bucket in a different account, you need to specify the S3 bucket owner's account ID using the --s3-bucket-owner parameter in the CLI command.
When you export via the console, AWS automatically handles this cross-account information, but in the CLI you must explicitly provide it. This is why your console export succeeds while the CLI export fails with an "Access Denied" error.
To fix your CLI command, add the S3 bucket owner's account ID parameter:
aws dynamodb export-table-to-point-in-time \
--profile "ACCOUNT_B_PROFILE" \
--region "$REGION" \
--table-arn "$TABLE_ARN" \
--s3-bucket "$S3_BUCKET" \
--s3-bucket-owner "ACCOUNT_A_ID" \
--export-format DYNAMODB_JSON \
--s3-sse-algorithm AES256
The s3-bucket-owner parameter is required when exporting to an S3 bucket in another account. Additionally, specifying the encryption algorithm (--s3-sse-algorithm AES256) is a good practice for cross-account exports.
Sources
Resolve access issues when you export from DynamoDB to Amazon S3 | AWS re:Post
export-table-to-point-in-time — AWS CLI 2.27.36 Command Reference
Requesting a table export in DynamoDB - Amazon DynamoDB
Apart from repost' answer, Are you using the same permissions while using from AWS console and CLI? Make sure these have same permissions. Also, what about bucket policy - does it allow writing from both the console user and you CLI profile?
Hi, thanks for your help but the above worked solution seemed to work for me. I just needed to add the s3-bucket-owner parameter
Relevant content
- asked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 months ago

Adding the s3-bucket-owner parameter as the account ID worked, thank you.