I am trying to put a variable in the AWS CLI DynamoDB command for add a row in a table:
aws dynamodb put-item --table-name table_name --item '{"id_proceso": {"N": "1"}, "fecha_proceso": {"S": "20210707170486"}, "status": {"S": "OK"}, "fecha_termino": {"S": "fecha_termino_var" } }' --region us-east-1
Where fecha_termino_var it should be a variable. example: fecha_termino_var=(date +'%Y/%m/%d %H:%M:%S')
but I have tried various ways but I have not managed to do it, is there any way to enter a variable in a aws cli command line?
The goal it is to add a row, which will contain a variable of the date in real time.
I've tried various ways but it just adds the variable type, in this case "date", or just the variable name in text plain "fecha_termino_var".
I'm working in a shell (.sh) to do this.
Failed image adds:


$ {date}? Why do you use single quotes?date=(date +'%Y/%m/%d %H:%M:%S')is supposed to do? Can you explain? You are overwriting date with date?date=(date +'%Y/%m/%d %H:%M:%S')wrong. Is this bash? What do you think it does?