【问题标题】:Value of property SubnetIds must be of type List of String error属性 SubnetIds 的值必须是字符串类型错误列表
【发布时间】:2022-01-21 00:14:37
【问题描述】:

我已经将 subnetIds 作为列表传递,但仍然出现错误:

  VpcEndpointSubnetIds:
    Type: "List<AWS::EC2::Subnet::Id>"
    Description: Select the subnet to associate with the VPC endpoint
    Default: 'subnet-039c1ac2c0925fe94,subnet-0e9267fe210b042da'

  VPCEndpointGateway:
      Type: AWS::EC2::VPCEndpoint
      Properties:
        VpcId: !Ref VpcId
        ServiceName: !Ref dynamoDbEndPointServiceName
        VpcEndpointType: Gateway
        PrivateDnsEnabled: true
        SubnetIds:
          -
            !Ref VpcEndpointSubnetIds
        SecurityGroupIds:
          -
            !Ref cacheSecurityGroup

不确定是什么导致了错误?我错过了什么吗?

更新: 修复间距问题后,现在出现错误:

Value of property {/SubnetIds/0} does not match type {String}

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation aws-sam


    【解决方案1】:

    这看起来像是模板格式问题。

    此外,SubnetIds 属性仅受 InterfaceGateway Load Balancer VPC 端点类型支持。对于 Gateway 类型,您不能使用此属性,因此您需要将其删除:

      VPCEndpointGateway:
          Type: AWS::EC2::VPCEndpoint
          Properties:
            VpcId: !Ref VpcId
            ServiceName: !Ref dynamoDbEndPointServiceName
            VpcEndpointType: Gateway
            PrivateDnsEnabled: true
            SecurityGroupIds:
              - !Ref cacheSecurityGroup
    

    有关更多信息,请查看AWS::EC2::VPCEndpoint 文档

    【讨论】:

    • 问题是加入,,但我收到其他错误:Subnet IDs are only supported for Interface and GatewayLoadBalancer type VPC Endpoints. (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameter; Request ID: cd121a48-cfd4-499a-9742- 38d501c4ef96;
    猜你喜欢
    • 2020-03-25
    • 2021-12-05
    • 2020-07-14
    • 1970-01-01
    • 1970-01-01
    • 2020-11-06
    • 2021-08-06
    • 2019-03-16
    • 1970-01-01
    相关资源
    最近更新 更多