Aws-cli: Unable to pass list on CLI for Type: List<AWS::EC2::Subnet::Id>

Created on 7 Mar 2017  路  3Comments  路  Source: aws/aws-cli

Issue #1529 isn't solving my problem here.

My CLI version is:

aws --version
aws-cli/1.11.57 Python/2.7.12 Darwin/15.5.0 botocore/1.5.20

on OSX Sierra

param definition

VPCSubnetIds:
  Type: List<AWS::EC2::Subnet::Id>

Error 1: Must be type list of string

Value of property SubnetIds must be of type List of String

the above is output from cfn events with any of the following:

  • ParameterKey=VPCSubnetIds,ParameterValue='subnet-f605a0bf\,subnet-ce3cbfa9'
  • ParameterKey=VPCSubnetIds,ParameterValue=\"subnet-f605a0bf,subnet-ce3cbfa9\"

Error 2: Wrong List type error

Invalid type for parameter Parameters[2].ParameterValue, value: [u'subnet-f605a0bf', u'subnet-ce3cbfa9'], type: , valid types:

the above is output from cli with any of the following:

  • ParameterKey=VPCSubnetIds,ParameterValue='subnet-f605a0bf,subnet-ce3cbfa9'
  • ParameterKey=VPCSubnetIds,ParameterValue=subnet-f605a0bf,subnet-ce3cbfa9
  • ParameterKey=VPCSubnetIds,ParameterValue='"subnet-f605a0bf","subnet-ce3cbfa9"'
  • ParameterKey=VPCSubnetIds,ParameterValue="'subnet-f605a0bf','subnet-ce3cbfa9'"
  • ParameterKey=VPCSubnetIds,ParameterValue='subnet-f605a0bf','subnet-ce3cbfa9'
  • 'ParameterKey=VPCSubnetIds,ParameterValue="subnet-f605a0bf","subnet-ce3cbfa9"'

The value is being used here:

  LambdaName:
    Type: AWS::Lambda::Function
    Properties:
      VpcConfig:
        SecurityGroupIds:
          - !Ref VPCSecurityGroup
        SubnetIds:
          - !Ref VPCSubnetIds

This should pull a list of strings into the !Ref VPCSubnetIds correct?

Is it broken? Or am I broken?

closing-soon cloudformation guidance

Most helpful comment

@brettswift you might have figured it out already, but what worked for me was to escape the comma. This also had me stumped. I tried a bunch of your examples, then escaped the comma and it worked. Try this:

ParameterKey=VPCSubnetIds,ParameterValue="subnet-f605a0bf\,subnet-ce3cbfa9"

All 3 comments

Could you provide debug logs? The second line should how exactly what got passed into the cli. Later down the line it will show what the request looks like if it gets to that point.

@brettswift you might have figured it out already, but what worked for me was to escape the comma. This also had me stumped. I tried a bunch of your examples, then escaped the comma and it worked. Try this:

ParameterKey=VPCSubnetIds,ParameterValue="subnet-f605a0bf\,subnet-ce3cbfa9"
Was this page helpful?
0 / 5 - 0 ratings