github.com/simonswine/terraform@v0.9.0-beta2/website/source/docs/providers/aws/r/network_acl_rule.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_network_acl_rule" 4 sidebar_current: "docs-aws-resource-network-acl-rule" 5 description: |- 6 Provides an network ACL Rule resource. 7 --- 8 9 # aws\_network\_acl\_rule 10 11 Creates an entry (a rule) in a network ACL with the specified rule number. 12 13 ## Example Usage 14 15 ``` 16 resource "aws_network_acl" "bar" { 17 vpc_id = "${aws_vpc.foo.id}" 18 } 19 20 resource "aws_network_acl_rule" "bar" { 21 network_acl_id = "${aws_network_acl.bar.id}" 22 rule_number = 200 23 egress = false 24 protocol = "tcp" 25 rule_action = "allow" 26 cidr_block = "0.0.0.0/0" 27 from_port = 22 28 to_port = 22 29 } 30 ``` 31 32 ## Argument Reference 33 34 The following arguments are supported: 35 36 * `network_acl_id` - (Required) The ID of the network ACL. 37 * `rule_number` - (Required) The rule number for the entry (for example, 100). ACL entries are processed in ascending order by rule number. 38 * `egress` - (Optional, bool) Indicates whether this is an egress rule (rule is applied to traffic leaving the subnet). Default `false`. 39 * `protocol` - (Required) The protocol. A value of -1 means all protocols. 40 * `rule_action` - (Required) Indicates whether to allow or deny the traffic that matches the rule. Accepted values: `allow` | `deny` 41 * `cidr_block` - (Required) The network range to allow or deny, in CIDR notation (for example 172.16.0.0/24 ). 42 * `from_port` - (Optional) The from port to match. 43 * `to_port` - (Optional) The to port to match. 44 * `icmp_type` - (Optional) ICMP protocol: The ICMP type. Required if specifying ICMP for the protocol. e.g. -1 45 * `icmp_code` - (Optional) ICMP protocol: The ICMP code. Required if specifying ICMP for the protocol. e.g. -1 46 47 ~> **NOTE:** If the value of `protocol` is `-1` or `all`, the `from_port` and `to_port` values will be ignored and the rule will apply to all ports. 48 49 ~> **NOTE:** If the value of `icmp_type` is `-1` (which results in a wildcard ICMP type), the `icmp_code` must also be set to `-1` (wildcard ICMP code). 50 51 ~> Note: For more information on ICMP types and codes, see here: http://www.nthelp.com/icmp.html 52 53 ## Attributes Reference 54 55 The following attributes are exported: 56 57 * `id` - The ID of the network ACL Rule