Last active
January 11, 2024 02:25
-
-
Save kdabir/9c086970e0b1a53c3df491b20fcb0839 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