2017-08-05 96 views
1

我瞭解AWS安全組上的egress屬性控制出站流量,但是沒有人知道-1的協議是什麼意思?AWS安全組出站的協議-1是什麼意思?

resource "aws_security_group" "elb" { 
    name = "example-elb」 
    ingress { 
    from_port = 80 
    to_port = 80 
    protocol = "tcp」 
    cidr_blocks = [" 0.0.0.0/ 0」] 
    } 
    egress { 
    from_port = 0 
    to_port = 0 
    protocol = "-1" 
    cidr_blocks = [" 0.0.0.0/ 0"] } 
} 

回答

4

它在the documentation

IP協議名稱(TCP,UDP,ICMP)或數字(見協議編號)。 (僅限VPC)使用-1指定所有協議。如果指定-1或tcp,udp,icmp或58(ICMPv6)以外的協議號,則允許所有端口上的流量,而不管您指定的是哪個端口。對於tcp,udp和icmp,您必須指定端口範圍。對於協議58(ICMPv6),您可以選擇指定一個端口範圍;如果您不這樣做,則允許所有類型和代碼的流量。