Skip to content
alex [dot] kramer [at] g_m_a_i_l [dot] com edited this page Jul 10, 2020 · 3 revisions

List and download file from S3 bucket

AWS_ACCESS_KEY_ID=XXX AWS_SECRET_ACCESS_KEY=XXX aws s3 ls s3://S3_BUCKET
AWS_ACCESS_KEY_ID=XXX AWS_SECRET_ACCESS_KEY=XXX aws s3 cp s3://S3_BUCKET/FILENAME /tmp/FILENAME

S3 Bucket Policies

Give complete access for all objects in a bucket to another account

{
    "Version": "2019-11-04",
    "Statement": [
        {
            "Sid": "ListObjectsInBucket",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::[AWS IAM ID GOES HERE]:root"
            },
            "Action": ["s3:ListBucket"],
            "Resource": ["arn:aws:s3:::[BUCKET NAME GOES HERE]"]
        },
        {
            "Sid": "AllObjectActions",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::[AWS IAM ID GOES HERE]:root"
            },
            "Action": "s3:*Object",
            "Resource": ["arn:aws:s3:::[BUCKET NAME GOES HERE]/*"]
        }
    ]
}
Clone this wiki locally