How to pass a variable into json file

Spread the love

I am trying to pass a variable into a json file.
This is my script:
for BucketName in `aws s3api list-buckets | jq ‘.Buckets[].Name’ | sed ‘s/”//g’`;
if [ “$(aws s3api put-bucket-policy –bucket $BucketName –policy file://policy.json)” ]; then
echo “Passed”
echo “Failed”

In file://policy.json I need to pass a variable called BucketName in the for loop.
This is my json file:
“Sid”: ,
“Effect”: “Deny”,
“Principal”: “*”,
“Action”: “s3:GetObject”,
“Resource”: “arn:aws:s3:::”‘$BucketName'”/*”,
“Condition”: {
“Bool”: {
“aws:SecureTransport”: “false”

Any idea?

X ITM Cloud News


Leave a Reply

Next Post

Where can I find a list of ports for update to give to our ISP so that we can update Ubuntu Server 18.04?

Fri Sep 11 , 2020
Spread the love          Original title: Не могу обновить или установить пакеты Ubuntu server 18.04 Can’t update or install packages on Ubuntu server 18.04. Internet provider Rostelecom, we sit behind their proxy server and content filtering. And so that we could work normally with Ubuntu server 18.04, they ask us to provide […]

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware