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
gefragt vor 2 Monaten172 Aufrufe
1 Antwort
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
EXPERTE
beantwortet vor 2 Monaten
profile picture
EXPERTE
überprüft vor 2 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen