Aws-cli: 无法在 CLI 上为类型传递列表:List<:ec2::subnet::id i="4"/>

创建于 2017-03-07  ·  3评论  ·  资料来源: aws/aws-cli

问题 #1529 并没有解决我的问题。

我的 CLI 版本是:

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

在 OSX 塞拉

参数定义

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

错误1:必须是字符串类型列表

属性 SubnetIds 的值必须是字符串列表类型

以上是 cfn 事件的输出,具有以下任何一项:

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

错误2:错误列表类型错误

参数Parameters[2].ParameterValue的类型无效,值:[u'subnet-f605a0bf',u'subnet-ce3cbfa9'],类型:, 有效类型:

以上是 cli 的输出,具有以下任何一项:

  • 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"'

这里使用的值:

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

这应该将字符串列表拉入!Ref VPCSubnetIds对吗?

它坏了吗? 还是我坏了?

closing-soon cloudformation guidance

最有用的评论

@brettswift您可能已经想通了,但是对我有用的是逃避逗号。 这也让我难过。 我尝试了一堆你的例子,然后转义了逗号并且它起作用了。 尝试这个:

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

所有3条评论

你能提供调试日志吗? 第二行应该如何准确地传递到 cli。 稍后,它将显示请求到达该点时的样子。

@brettswift您可能已经想通了,但是对我有用的是逃避逗号。 这也让我难过。 我尝试了一堆你的例子,然后转义了逗号并且它起作用了。 尝试这个:

ParameterKey=VPCSubnetIds,ParameterValue="subnet-f605a0bf\,subnet-ce3cbfa9"
此页面是否有帮助?
0 / 5 - 0 等级