if (FALSE) {
# This example enables inbound traffic on TCP port 22 (SSH). The rule
# includes a description to help you identify it later.
svc$authorize_security_group_ingress(
GroupId = "sg-903004f8",
IpPermissions = list(
list(
FromPort = 22L,
IpProtocol = "tcp",
IpRanges = list(
list(
CidrIp = "203.0.113.0/24",
Description = "SSH access from the LA office"
)
),
ToPort = 22L
)
)
)
# This example enables inbound traffic on TCP port 80 from the specified
# security group. The group must be in the same VPC or a peer VPC.
# Incoming traffic is allowed based on the private IP addresses of
# instances that are associated with the specified security group.
svc$authorize_security_group_ingress(
GroupId = "sg-111aaa22",
IpPermissions = list(
list(
FromPort = 80L,
IpProtocol = "tcp",
ToPort = 80L,
UserIdGroupPairs = list(
list(
Description = "HTTP access from other instances",
GroupId = "sg-1a2b3c4d"
)
)
)
)
)
# This example adds an inbound rule that allows RDP traffic from the
# specified IPv6 address range. The rule includes a description to help
# you identify it later.
svc$authorize_security_group_ingress(
GroupId = "sg-123abc12 ",
IpPermissions = list(
list(
FromPort = 3389L,
IpProtocol = "tcp",
Ipv6Ranges = list(
list(
CidrIpv6 = "2001:db8:1234:1a00::/64",
Description = "RDP access from the NY office"
)
),
ToPort = 3389L
)
)
)
}
Run the code above in your browser using DataLab