- Install boto3
- Create IAM user with a similar policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:ListBucketMultipartUploads",
"s3:ListMultipartUploadParts",
"s3:GetObject",
"s3:GetBucketLocation",
],
"Resource": [
"arn:aws:s3:::your_bucket_name"
]
}
]
}
- Create a profile in ~/.aws/credentials with access details of this IAM user as explained in boto documentation
download_s3_bucket(bucket_name = your_bucket_name, local_folder = "/tmp/s3_bucket", aws_user_with_s3_access = profile_name)