cat << EOF > ${FILE_IAM_POLICY_DOC}
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListObjectsInBucket",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": ["arn:aws:s3:::${S3_BUCKET_NAME}"]
},
{
"Sid": "AllObjectActions",
"Effect": "Allow",
"Action": "s3:*Object",
"Resource": ["arn:aws:s3:::${S3_BUCKET_NAME}/*"]
}
]
}
EOF
cat ${FILE_IAM_POLICY_DOC}