How to input shell parametes in AWS CLI

Viewed 38

I've got two shell parameters

AID="subnet-00000"
BID="subnet-11111"

And I can't execute below statement.

aws rds create-db-subnet-group \
 --db-subnet-group-name dbsubnet-$service_name \
 --db-subnet-group-description "dbsubnet-$service_name" \
 --subnet-ids '[$AID, $BID]'

The error message is saying that Expecting value: line 1 column 2 (char 1)

How can I put my parameters into aws cli statement?

1 Answers

Since you've used single-quote, the variables wont be resolved. Also you can skip square brackets:

aws rds create-db-subnet-group \
 --db-subnet-group-name dbsubnet-$service_name \
 --db-subnet-group-description "dbsubnet-$service_name" \
 --subnet-ids $AID $BID
Related