Error in aws-alias.sh
dschaehi opened this issue · comments
Jae Hee Lee commented
After --filters option two Name/Value pairs should separated by a space and not by a comma. Otherwise "--filter" option does not behave as expected.
Using the following I got the correct result:
alias aws-get-p2='export instanceId=`aws ec2 describe-instances --filters Name="instance-state-name",Values="stopped" Name="instance-type",Values="p2.xlarge" --query "Reservations[0].Instances[0].InstanceId"` && echo $instanceId'
alias aws-get-t2='export instanceId=`aws ec2 describe-instances --filters Name="instance-state-name",Values="stopped" Name="instance-type",Values="t2.xlarge" --query "Reservations[0].Instances[0].InstanceId"` && echo $instanceId'