-
-
Save adam-stokes/619872d1b6e29da4f4c930a5ca1f5051 to your computer and use it in GitHub Desktop.
json in heredoc in bash script alongwith variable substitution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_BUCKET_NAME="foo.example.com" | |
_POLICY=$(cat <<EOT | |
{ | |
"Version":"2012-10-17", | |
"Statement":[{ | |
"Sid":"PublicReadForGetBucketObjects", | |
"Effect":"Allow", | |
"Principal": "*", | |
"Action":["s3:GetObject"], | |
"Resource":["arn:aws:s3:::${_BUCKET_NAME}/*"] | |
}] | |
} | |
EOT | |
) | |
echo ${_POLICY} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment