Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
278 views
in Technique[技术] by (71.8m points)

amazon web services - How to input shell parametes in AWS CLI

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?

question from:https://stackoverflow.com/questions/65930891/how-to-input-shell-parametes-in-aws-cli

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...