【问题标题】:Subnet IDs are only supported for Interface and GatewayLoadBalancer type VPC Endpoints仅接口和 GatewayLoadBalancer 类型的 VPC 终端节点支持子网 ID
【发布时间】:2022-01-20 21:21:40
【问题描述】:

Aws dynamoDb 仅支持 Gateway 端点,但我在部署时遇到错误:

Subnet IDs are only supported for Interface and GatewayLoadBalancer type VPC Endpoints. (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameter)

这是子网的问题吗?

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

【问题讨论】:

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


    【解决方案1】:

    在创建 VPCEndpoints 时,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 文档

    【讨论】:

      猜你喜欢
      • 2021-06-22
      • 2020-02-07
      • 1970-01-01
      • 2020-10-11
      • 2020-01-04
      • 2021-04-03
      • 1970-01-01
      • 2021-04-17
      • 2021-04-06
      相关资源
      最近更新 更多