
json 파일에 변수를 전달하려고 합니다.
이것은 내 스크립트입니다.
#!/bin/sh
for BucketName in `aws s3api list-buckets | jq '.Buckets[].Name' | sed 's/"//g'`;
do
if [ "$(aws s3api put-bucket-policy --bucket $BucketName --policy file://policy.json)" ]; then
echo "Passed"
elso
echo "Failed"
fi
done
for 루프에서 file://policy.json
호출되는 변수를 전달해야 합니다 .BucketName
이것은 내 JSON 파일입니다.
{
"Sid": ,
"Effect": "Deny",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::"'$BucketName'"/*",
"Condition": {
"Bool": {
"aws:SecureTransport": "false"
}
}
}
어떤 아이디어?