subnets: Subnets

Description Usage Arguments Details Value References See Also Examples

Description

Get, create, and delete subnets

Usage

1
2
3
4
5
describe_subnets(subnet = NULL, filter = NULL, ...)

create_subnet(vpc, cidr, zone = NULL, ...)

delete_subnet(subnet, ...)

Arguments

subnet

A character string containing the name of a subnet, or an object of class “ec2_subnet”.

filter

...

...

Additional arguments passed to [ec2HTTP()].

vpc

A character string specifying a VPC Allocation ID or an object of class “ec2_ip”.

cidr

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

zone

Optionally, a character string specifying an availability zone (see describe_zones()) or an object of class “ec2_zone”. If omitted, a zone is selected automatically.

Details

Use create_netacl() and associate_netacl() to specify a non-default Access Control List (ACL) for the subnet

Value

A list of objects of class “ec2_subnet”.

References

http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSubnet.html http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteSubnet.html

See Also

create_vpc(), create_netacl(), associate_netacl()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# describe existing subnets
(d <- describe_subnets())
describe_subnets(d[[1]])

# create a subnet
## setup new VPC IP address
new_ip <- allocate_ip("vpc")
aid <- describe_ips(new_ip$publicIp)[[1]]$allocationId
s <- create_subnet(aid, cidr = "10.0.1.0/24")

# delete a subnet


## End(Not run)

cloudyr/aws.ec2 documentation built on Jan. 14, 2020, 4:55 a.m.