How to to specify Port Range in aws_network_acl rules

636 views
Skip to first unread message

Rajinder Singh

unread,
Oct 17, 2015, 4:55:20 PM10/17/15
to Terraform
I am creating a network acl for my subnet.
I need to define an ingress rule for ephemeral ports.
This requires specifying a port range like this one: 49152-65535


Documentation of aws_network_acl is here:

to_port only allows specifying an integer. How can I specify a port range.

Raj

Daniel Bethke

unread,
Oct 17, 2015, 6:02:19 PM10/17/15
to Terraform
There should also be a from_port that you can use for the beginning of the range

i think it should look something like this:

  ingress {
    rule_no     = 140
    from_port   49152
    to_port     65535
    action     = "allow"
    protocol   = "6"
    cidr_block = "0.0.0.0/0"
  }

knope

unread,
Oct 22, 2015, 4:13:32 PM10/22/15
to Terraform
you are correct. 
Reply all
Reply to author
Forward
0 new messages