如何指定安全组中的所有端口 - CloudFormation [英] How to specify all ports in Security group - CloudFormation
本文介绍了如何指定安全组中的所有端口 - CloudFormation的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我现在有这样的 CloudFormation 脚本:
I have my CloudFormation script like this now:
"SecurityGroupIngress" : [{
"IpProtocol" : "tcp",
"FromPort" : "0",
"ToPort" : "65535",
"CidrIp" : "0.0.0.0/0"
}]
它看起来像这样,这很好:
and it looks like this, which is fine:
但我想知道如何更新模板以获取此信息:
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屋!
查看全文