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
preguntada hace 2 meses179 visualizaciones
1 Respuesta
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
EXPERTO
respondido hace 2 meses
profile picture
EXPERTO
revisado hace 2 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas