Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to pass list on CLI for Type: List<AWS::EC2::Subnet::Id> #2478

Closed
brettswift opened this issue Mar 7, 2017 · 4 comments
Closed

Unable to pass list on CLI for Type: List<AWS::EC2::Subnet::Id> #2478

brettswift opened this issue Mar 7, 2017 · 4 comments
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. cloudformation guidance Question that needs advice or information.

Comments

@brettswift
Copy link

brettswift commented Mar 7, 2017

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: <type 'list'>, valid types: <type 'basestring'>

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?

@JordonPhillips
Copy link
Member

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.

@JordonPhillips JordonPhillips added closing-soon This issue will automatically close in 4 days unless further comments are made. cloudformation question labels Mar 9, 2017
@tuler
Copy link

tuler commented Feb 22, 2018

https://aws.amazon.com/pt/premiumsupport/knowledge-center/multiple-values-list-parameter-cli/

@corpulent
Copy link

@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"

@zubeyirtercan
Copy link

Escaping only the comma (without the quotes) also worked

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. cloudformation guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

7 participants