how to pass variables in aws cli command (json) ?

0

I want to run aws cli command , in say amazon provided linux container, not sure if it comes with the aws cli , but probably can do a pip install. I understand , there is a short hand and json version of the aws cli, say for example, we have command below , i would like to declare a variable , say Table_Name = 'some_table' and pass that in the command below. how do i do that , so the command would be => aws dynamdb update-table ....--table-name $Table_Name

aws dynamodb update-table \
    --provisioned-throughput '{"ReadCapacityUnits":15,"WriteCapacityUnits":10}' \
    --table-name MyDDBTable
asked a month ago144 views
1 Answer
0

Hello.

I think it's possible to set variables within JSON.
For example, if you do the following, the value test1 will be set in the EC2 tag.

test=test1
aws ec2 create-tags --resources i-aaaaaaaaaaaaa --tags '[{"Key": "test", "Value": "'$test'"}]'
profile picture
EXPERT
answered a month ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions