简体   繁体   English

ELB 故障 - 一个 AZ 中的多个 su.net

[英]ELB failure - Multiple subnets in one AZ

We are trying to create a Network Load Balancer through cloudformation in the private su.net and we have 6 private su.nets - 2 in each availability zone.我们正在尝试通过私有 su.net 中的 cloudformation 创建网络负载均衡器,我们有 6 个私有 su.net - 每个可用区 2 个。

Currently we pass in the Su.netIDs manually by picking one su.net in each AZ as below.目前,我们通过在每个 AZ 中选择一个 su.net 来手动传递 Su.netID,如下所示。

LoadBalancer:
        Type: AWS::ElasticLoadBalancingV2::LoadBalancer
        Properties:
          Type: network
          Scheme: internal
          Subnets: !Ref SubnetID
          Tags:
            - Key: Name
              Value: !Ref EnvName

where Su.netID is a parameter that accepts a list of strings.其中Su.netID是接受字符串列表的参数。

Is there a way to get this su.net information automatically in cloudformation (pick private su.net ids one for each availability zone) through infrastructure as code有没有一种方法可以通过基础架构即代码在 cloudformation 中自动获取此 su.net 信息(为每个可用区选择一个私有 su.net id)

PS: Passing all the 6 su.nets as a list fails the load balancer creation because LB somehow picks 2 su.nets in the same AZ and that is not allowed. PS:将所有 6 个 su.net 作为列表传递会导致负载均衡器创建失败,因为 LB 以某种方式在同一 AZ 中选择了 2 个 su.net,这是不允许的。

I am looking for a fully automated solution or any best practice to do this?我正在寻找一个完全自动化的解决方案或任何最佳实践来做到这一点?

If you know which su.nets in the list are private you can manually hand pick them.如果您知道列表中的哪些 su.net 是私有的,您可以手动选择它们。 For example:例如:

Subnets:
  - !Select [0, !Ref SubnetID]
  - !Select [1, !Ref SubnetID]

For fully autonomous solution when you don't know which su.nets are private, which not, you would have to develop a custom resource lambda function which would return the list of su.nets of interest into your CFN stack.对于完全自主的解决方案,当您不知道哪些 su.net 是私有的,哪些不是时,您将不得不开发一个自定义资源lambda function 它将感兴趣的 su.net 列表返回到您的 CFN 堆栈中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM