如何在安全组中指定所有端口-CloudFormation [英] How to specify all ports in Security group - CloudFormation

查看:86
本文介绍了如何在安全组中指定所有端口-CloudFormation的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有这样的CloudFormation脚本:

I have my CloudFormation script like this now:

    "SecurityGroupIngress" : [{
      "IpProtocol" : "tcp",
      "FromPort" : "0",
      "ToPort" : "65535",
      "CidrIp" : "0.0.0.0/0"
    }]

看起来像这样,很好:

但是我想知道如何更新模板以获取此信息:

But I am wondering how to I update the template to get this:

请注意端口说明全部。我还想知道它们是否不同吗?

Notice the Ports say All. I also wonder if they are different?

推荐答案

我发布的原始解决方案(并被原始海报接受)停止了作为AWS的工作不再支持它。为了避免大举投票,我删除了答案。替代方法是:

The original solution I posted (and accepted by the original poster) stopped working as AWS no longer supports it. To avoid the barrage of downvotes, I deleted the answer. The alternatives are:


  • 指定端口0和65535

打开所有协议的所有端口,而不仅仅是TCP(如 thewire247所建议的以下)

Open all ports for all protocols not just TCP (as suggested by thewire247 below)

"SecurityGroupIngress" : [{
  "IpProtocol" : "-1",
  "CidrIp" : "0.0.0.0/0"
}]

这篇关于如何在安全组中指定所有端口-CloudFormation的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆