acl_rules: ACL Rules

Description Usage Arguments Details Value References Examples

Description

Set/Replace/Delete ACL Rules

Usage

1
2
3
4
5
6
7
8
create_netacl_rule(acl, rule, cidr, port, protocol = "-1",
  action = c("allow", "deny"), direction = c("ingress", "egress"), ...)

replace_netacl_rule(acl, rule, cidr, port, protocol = "-1",
  action = c("allow", "deny"), direction = c("ingress", "egress"), ...)

delete_netacl_rule(acl, rule, protocol = "-1", direction = c("ingress",
  "egress"), ...)

Arguments

acl

...

rule

A positive integer between 1 and 32766 to identify the rule. AWS advises staggering rule numbers (e.g., by 10s).

cidr

A character string specifying a network range for the subnet in CIDR notation.

port

A one- or two-element integer vector, specifying a port or port range.

protocol

A character string specifying a protocol. A value of “-1” (the default) means all protocols.

action

A character vector specifying one of “allow” (the default) or “deny”.

direction

A character vector specifying one of “ingress” (the default) or egress.

...

Additional arguments passed to [ec2HTTP()].

Details

Network ACL rules control inbound and outbound traffic. An ACL is, by default, created without any rules. create_netacl_rule adds a new rule. Each Network ACL rule consists of a a unique identifying number, an access protocol, an action (“allow” or “deny”), a direction (ingress or egress), a CIDR block, and a port range. Rules cannot be modified, but they can be deleted and replaced. replace_netacl_rule replaces an existing rule. delete_netacl_rule deletes an existing rule.

Value

A logical indicating whether the operation succeeded.

References

http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkAclEntry.html http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ReplaceNetworkAclEntry.html http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteNetworkAclEntry.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
# create a VPC
v <- create_vpc(cidr = "10.0.0.0/16")
describe_vpcs()

# create a Network ACL for the VPC
acl <- create_netacl(v)

# add a rule
create_netacl_rule(acl, rule = 1000, cidr = "10.0.0.0/16", port = "80")

# retrieve the ACL (see rule is added)
describe_netacls(acl)

# replace the rule
replace_netacl_rule(acl, rule = 1000, cidr = "10.0.0.0/0", port = "32")

# cleanup
delete_netacl_rule(acl, 1000, protocol = "-1")
delete_netacl(acl)
delete_vpc(v)

## End(Not run)

HanjoStudy/awsR documentation built on May 6, 2019, 9:06 a.m.