#!/bin/bash echo "Input user ARN: " read userArn echo "" echo "Input bucket ARN: " read bucketArn echo "" echo "" cat << EOF { "Version": "2012-10-17", "Statement": [ { "Action": "s3:*", "Effect": "Allow", "Resource": [ "$bucketArn", "$bucketArn/*" ], "Principal": { "AWS": [ "$userArn" ] } }, { "Action": [ "s3:ListAllMyBuckets" ], "Effect": "Allow", "Resource": "*", "Principal": { "AWS": [ "$userArn" ] } } ] } EOF