CommaDelimitedList parameter and command line

1,624 views
Skip to first unread message

emmanuel...@menlosecurity.com

unread,
Feb 3, 2016, 7:50:29 PM2/3/16
to cloudtools-dev
How can I pass comma delimited list parameters at the command line?

HERE IS THE ERROR
aws --profile 7009 --output table --region us-west-1  cloudformation create-stack --stack-name Release001a --parameters ParameterKey=JumpHostCidrs,ParameterValue='52.53.216.135/32, 54.183.176.252/32

Parameter validation failed:
Invalid type for parameter Parameters[0].ParameterValue, value: [u'52.53.216.135/32', u'54.183.176.252/32'], type: <type 'list'>, valid types: <type 'basestring'>
make: *** [_cloudformation_s3_create_stack] Error 255

HERE IS THE RELEVANT SECTION OF THE TEMPLATE
    "JumpHostCidrs": {
      "ConstraintDescription": "must be a comma delimited list of 2 IP addresses x.x.x.x/32",
      "Default": "50.250.253.241/32, 50.250.253.241/32",
      "Description": "Comma-delimited list of 2 IP addresses",
      "Type": "CommaDelimitedList"
    },

Why is the awscli expecting the basestring type?
If I don't pass the parameter on the command line, the default value works fine and as expected in the template (Select(0... etc))

Any clue is appreciated.
--
Emmanuel

Michael Barrett

unread,
Feb 3, 2016, 7:55:48 PM2/3/16
to emmanuel...@menlosecurity.com, cloudtools-dev
It seems like what you're doing should be right, this seems to indicate that you should single quote AND escape the commas though: https://forums.aws.amazon.com/thread.jspa?threadID=142854

Not sure why, or if that will actually help.

--
You received this message because you are subscribed to the Google Groups "cloudtools-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloudtools-de...@googlegroups.com.
To post to this group, send email to cloudto...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloudtools-dev/15d99eff-4224-4353-9d3f-9779c2311dc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

emmanuel...@menlosecurity.com

unread,
Feb 3, 2016, 7:57:43 PM2/3/16
to cloudtools-dev

It is actually an issue related to the awscli


https://github.com/aws/aws-cli/issues/1529


 I got it working by escaping the quotes or surrounding in single quotes:

ParameterKey=SecurityGroups,ParameterValue=\"sg-11111111,sg-22222222\"

'ParameterKey=SecurityGroups,ParameterValue="sg-11111111,sg-22222222"'

--
Emmanuel
Reply all
Reply to author
Forward
0 new messages