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 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则