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
已提問 2 個月前檢視次數 172 次
1 個回答
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
專家
已回答 2 個月前
profile picture
專家
已審閱 2 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南