You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::EC2::Vpc
- Inherits:
-
Resources::Resource
- Object
- Resources::Resource
- Aws::EC2::Vpc
- Defined in:
- (unknown)
Instance Attribute Summary collapse
-
#cidr_block ⇒ String
readonly
The primary IPv4 CIDR block for the VPC.
-
#cidr_block_association_set ⇒ Array<Types::VpcCidrBlockAssociation>
readonly
Information about the IPv4 CIDR blocks associated with the VPC.
-
#dhcp_options_id ⇒ String
readonly
The ID of the set of DHCP options you\'ve associated with the VPC.
-
#id ⇒ String
readonly
-
#instance_tenancy ⇒ String
readonly
The allowed tenancy of instances launched into the VPC.
-
#ipv_6_cidr_block_association_set ⇒ Array<Types::VpcIpv6CidrBlockAssociation>
readonly
Information about the IPv6 CIDR blocks associated with the VPC.
-
#is_default ⇒ Boolean
readonly
Indicates whether the VPC is the default VPC.
-
#owner_id ⇒ String
readonly
The ID of the AWS account that owns the VPC.
-
#state ⇒ String
readonly
The current state of the VPC.
-
#tags ⇒ Array<Types::Tag>
readonly
Any tags assigned to the VPC.
-
#vpc_id ⇒ String
readonly
The ID of the VPC.
Attributes inherited from Resources::Resource
Instance Method Summary collapse
-
#accepted_vpc_peering_connections(options = {}) ⇒ Collection<VpcPeeringConnection>
Returns a Collection of VpcPeeringConnection resources.
-
#associate_dhcp_options(options = {}) ⇒ Struct
Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.
After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options.
-
#attach_classic_link_instance(options = {}) ⇒ Types::AttachClassicLinkVpcResult
Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's security groups.
-
#attach_internet_gateway(options = {}) ⇒ Struct
Attaches an internet gateway or a virtual private gateway to a VPC, enabling connectivity between the internet and the VPC.
-
#create_network_acl(options = {}) ⇒ NetworkAcl
-
#create_route_table(options = {}) ⇒ RouteTable
-
#create_security_group(options = {}) ⇒ SecurityGroup
-
#create_subnet(options = {}) ⇒ Subnet
-
#create_tags(options = {}) ⇒ Array<Tag>
-
#delete(options = {}) ⇒ Struct
Deletes the specified VPC.
-
#delete_tags(options = {}) ⇒ Array<Tag>
-
#describe_attribute(options = {}) ⇒ Types::DescribeVpcAttributeResult
Describes the specified attribute of the specified VPC.
-
#detach_classic_link_instance(options = {}) ⇒ Types::DetachClassicLinkVpcResult
Unlinks (detaches) a linked EC2-Classic instance from a VPC.
-
#detach_internet_gateway(options = {}) ⇒ Struct
Detaches an internet gateway from a VPC, disabling connectivity between the internet and the VPC.
-
#dhcp_options ⇒ DhcpOptions?
-
#disable_classic_link(options = {}) ⇒ Types::DisableVpcClassicLinkResult
Disables ClassicLink for a VPC.
-
#enable_classic_link(options = {}) ⇒ Types::EnableVpcClassicLinkResult
Enables a VPC for ClassicLink.
-
#exists? ⇒ Boolean
Returns
true
if this Vpc exists. -
#initialize ⇒ Object
constructor
-
#instances(options = {}) ⇒ Collection<Instance>
Returns a Collection of Instance resources.
-
#internet_gateways(options = {}) ⇒ Collection<InternetGateway>
Returns a Collection of InternetGateway resources.
-
#modify_attribute(options = {}) ⇒ Struct
Modifies the specified attribute of the specified VPC.
.
-
#network_acls(options = {}) ⇒ Collection<NetworkAcl>
Returns a Collection of NetworkAcl resources.
-
#network_interfaces(options = {}) ⇒ Collection<NetworkInterface>
Returns a Collection of NetworkInterface resources.
-
#request_vpc_peering_connection(options = {}) ⇒ VpcPeeringConnection
-
#requested_vpc_peering_connections(options = {}) ⇒ Collection<VpcPeeringConnection>
Returns a Collection of VpcPeeringConnection resources.
-
#route_tables(options = {}) ⇒ Collection<RouteTable>
Returns a Collection of RouteTable resources.
-
#security_groups(options = {}) ⇒ Collection<SecurityGroup>
Returns a Collection of SecurityGroup resources.
-
#subnets(options = {}) ⇒ Collection<Subnet>
Returns a Collection of Subnet resources.
-
#wait_until_available {|waiter| ... } ⇒ Vpc
Waits until this Vpc is available.
-
#wait_until_exists {|waiter| ... } ⇒ Vpc
Waits until this Vpc is exists.
Methods inherited from Resources::Resource
add_data_attribute, add_identifier, #data, data_attributes, #data_loaded?, identifiers, #load, #wait_until
Methods included from Resources::OperationMethods
#add_batch_operation, #add_operation, #batch_operation, #batch_operation_names, #batch_operations, #operation, #operation_names, #operations
Constructor Details
#initialize(id, options = {}) ⇒ Object #initialize(options = {}) ⇒ Object
Instance Attribute Details
#cidr_block ⇒ String (readonly)
The primary IPv4 CIDR block for the VPC.
#cidr_block_association_set ⇒ Array<Types::VpcCidrBlockAssociation> (readonly)
Information about the IPv4 CIDR blocks associated with the VPC.
#dhcp_options_id ⇒ String (readonly)
The ID of the set of DHCP options you\'ve associated with the VPC.
#id ⇒ String (readonly)
#instance_tenancy ⇒ String (readonly)
The allowed tenancy of instances launched into the VPC.
Possible values:
- default
- dedicated
- host
#ipv_6_cidr_block_association_set ⇒ Array<Types::VpcIpv6CidrBlockAssociation> (readonly)
Information about the IPv6 CIDR blocks associated with the VPC.
#is_default ⇒ Boolean (readonly)
Indicates whether the VPC is the default VPC.
#owner_id ⇒ String (readonly)
The ID of the AWS account that owns the VPC.
#state ⇒ String (readonly)
The current state of the VPC.
Possible values:
- pending
- available
#tags ⇒ Array<Types::Tag> (readonly)
Any tags assigned to the VPC.
#vpc_id ⇒ String (readonly)
The ID of the VPC.
Instance Method Details
#accepted_vpc_peering_connections(options = {}) ⇒ Collection<VpcPeeringConnection>
Returns a Collection of Aws::EC2::VpcPeeringConnection resources. No API requests are made until you call an enumerable method on the collection. Client#describe_vpc_peering_connections will be called multiple times until every Aws::EC2::VpcPeeringConnection has been yielded.
#associate_dhcp_options(options = {}) ⇒ Struct
Associates a set of DHCP options (that you've previously created) with the specified VPC, or associates no DHCP options with the VPC.
After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. You can explicitly renew the lease using the operating system on the instance.
For more information, see DHCP Options Sets in the Amazon Virtual Private Cloud User Guide.
#attach_classic_link_instance(options = {}) ⇒ Types::AttachClassicLinkVpcResult
Links an EC2-Classic instance to a ClassicLink-enabled VPC through one or more of the VPC's security groups. You cannot link an EC2-Classic instance to more than one VPC at a time. You can only link an instance that's in the running
state. An instance is automatically unlinked from a VPC when it's stopped - you can link it to the VPC again when you restart it.
After you've linked an instance, you cannot change the VPC security groups that are associated with it. To change the security groups, you must first unlink the instance, and then link it again.
Linking your instance to a VPC is sometimes referred to as attaching your instance.
#attach_internet_gateway(options = {}) ⇒ Struct
Attaches an internet gateway or a virtual private gateway to a VPC, enabling connectivity between the internet and the VPC. For more information about your VPC and internet gateway, see the Amazon Virtual Private Cloud User Guide.
#create_network_acl(options = {}) ⇒ NetworkAcl
#create_route_table(options = {}) ⇒ RouteTable
#create_security_group(options = {}) ⇒ SecurityGroup
#create_subnet(options = {}) ⇒ Subnet
#create_tags(options = {}) ⇒ Array<Tag>
#delete(options = {}) ⇒ Struct
Deletes the specified VPC. You must detach or delete all gateways and resources that are associated with the VPC before you can delete it. For example, you must terminate all instances running in the VPC, delete all security groups associated with the VPC (except the default one), delete all route tables associated with the VPC (except the default one), and so on.
#delete_tags(options = {}) ⇒ Array<Tag>
#describe_attribute(options = {}) ⇒ Types::DescribeVpcAttributeResult
Describes the specified attribute of the specified VPC. You can specify only one attribute at a time.
#detach_classic_link_instance(options = {}) ⇒ Types::DetachClassicLinkVpcResult
Unlinks (detaches) a linked EC2-Classic instance from a VPC. After the instance has been unlinked, the VPC security groups are no longer associated with it. An instance is automatically unlinked from a VPC when it's stopped.
#detach_internet_gateway(options = {}) ⇒ Struct
Detaches an internet gateway from a VPC, disabling connectivity between the internet and the VPC. The VPC must not contain any running instances with Elastic IP addresses or public IPv4 addresses.
#dhcp_options ⇒ DhcpOptions?
#disable_classic_link(options = {}) ⇒ Types::DisableVpcClassicLinkResult
Disables ClassicLink for a VPC. You cannot disable ClassicLink for a VPC that has EC2-Classic instances linked to it.
#enable_classic_link(options = {}) ⇒ Types::EnableVpcClassicLinkResult
Enables a VPC for ClassicLink. You can then link EC2-Classic instances to your ClassicLink-enabled VPC to allow communication over private IP addresses. You cannot enable your VPC for ClassicLink if any of your VPC route tables have existing routes for address ranges within the 10.0.0.0/8
IP address range, excluding local routes for VPCs in the 10.0.0.0/16
and 10.1.0.0/16
IP address ranges. For more information, see ClassicLink in the Amazon Elastic Compute Cloud User Guide.
#exists? ⇒ Boolean
Returns true
if this Vpc exists. Returns false
otherwise.
#instances(options = {}) ⇒ Collection<Instance>
Returns a Collection of Instance resources. No API requests are made until you call an enumerable method on the collection. Client#describe_instances will be called multiple times until every Instance has been yielded.
#internet_gateways(options = {}) ⇒ Collection<InternetGateway>
Returns a Collection of InternetGateway resources. No API requests are made until you call an enumerable method on the collection. Client#describe_internet_gateways will be called multiple times until every InternetGateway has been yielded.
#modify_attribute(options = {}) ⇒ Struct
Modifies the specified attribute of the specified VPC.
#network_acls(options = {}) ⇒ Collection<NetworkAcl>
Returns a Collection of NetworkAcl resources. No API requests are made until you call an enumerable method on the collection. Client#describe_network_acls will be called multiple times until every NetworkAcl has been yielded.
#network_interfaces(options = {}) ⇒ Collection<NetworkInterface>
Returns a Collection of NetworkInterface resources. No API requests are made until you call an enumerable method on the collection. Client#describe_network_interfaces will be called multiple times until every NetworkInterface has been yielded.
#request_vpc_peering_connection(options = {}) ⇒ VpcPeeringConnection
#requested_vpc_peering_connections(options = {}) ⇒ Collection<VpcPeeringConnection>
Returns a Collection of Aws::EC2::VpcPeeringConnection resources. No API requests are made until you call an enumerable method on the collection. Client#describe_vpc_peering_connections will be called multiple times until every Aws::EC2::VpcPeeringConnection has been yielded.
#route_tables(options = {}) ⇒ Collection<RouteTable>
Returns a Collection of RouteTable resources. No API requests are made until you call an enumerable method on the collection. Client#describe_route_tables will be called multiple times until every RouteTable has been yielded.
#security_groups(options = {}) ⇒ Collection<SecurityGroup>
Returns a Collection of SecurityGroup resources. No API requests are made until you call an enumerable method on the collection. Client#describe_security_groups will be called multiple times until every SecurityGroup has been yielded.
#subnets(options = {}) ⇒ Collection<Subnet>
Returns a Collection of Subnet resources. No API requests are made until you call an enumerable method on the collection. Client#describe_subnets will be called multiple times until every Subnet has been yielded.
#wait_until_available {|waiter| ... } ⇒ Vpc
Waits until this Vpc is available. This method waits by polling Client#describe_vpcs until successful. An error is raised after a configurable number of failed checks.
This waiter uses the following defaults:
Configuration | Default |
---|---|
#delay |
15 |
#max_attempts |
40 |
You can modify defaults and register callbacks by passing a block argument.
#wait_until_exists {|waiter| ... } ⇒ Vpc
Waits until this Vpc is exists. This method waits by polling Client#describe_vpcs until successful. An error is raised after a configurable number of failed checks.
This waiter uses the following defaults:
Configuration | Default |
---|---|
#delay |
1 |
#max_attempts |
5 |
You can modify defaults and register callbacks by passing a block argument.