Class: Aws::EC2::Vpc
- Inherits:
-
Object
- Object
- Aws::EC2::Vpc
- Defined in:
- gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb
Defined Under Namespace
Classes: Collection
Read-Only Attributes collapse
-
#cidr_block ⇒ String
The primary IPv4 CIDR block for the VPC.
-
#cidr_block_association_set ⇒ Array<Types::VpcCidrBlockAssociation>
Information about the IPv4 CIDR blocks associated with the VPC.
-
#dhcp_options_id ⇒ String
The ID of the set of DHCP options you've associated with the VPC.
-
#id ⇒ String
(also: #vpc_id)
-
#instance_tenancy ⇒ String
The allowed tenancy of instances launched into the VPC.
-
#ipv_6_cidr_block_association_set ⇒ Array<Types::VpcIpv6CidrBlockAssociation>
Information about the IPv6 CIDR blocks associated with the VPC.
-
#is_default ⇒ Boolean
Indicates whether the VPC is the default VPC.
-
#owner_id ⇒ String
The ID of the Amazon Web Services account that owns the VPC.
-
#state ⇒ String
The current state of the VPC.
-
#tags ⇒ Array<Types::Tag>
Any tags assigned to the VPC.
Actions collapse
-
#associate_dhcp_options(options = {}) ⇒ EmptyStructure
-
#attach_classic_link_instance(options = {}) ⇒ Types::AttachClassicLinkVpcResult
-
#attach_internet_gateway(options = {}) ⇒ EmptyStructure
-
#create_network_acl(options = {}) ⇒ NetworkAcl
-
#create_route_table(options = {}) ⇒ RouteTable
-
#create_security_group(options = {}) ⇒ SecurityGroup
-
#create_subnet(options = {}) ⇒ Subnet
-
#create_tags(options = {}) ⇒ Tag::Collection
-
#delete(options = {}) ⇒ EmptyStructure
-
#delete_tags(options = {}) ⇒ Tag::Collection
-
#describe_attribute(options = {}) ⇒ Types::DescribeVpcAttributeResult
-
#detach_classic_link_instance(options = {}) ⇒ Types::DetachClassicLinkVpcResult
-
#detach_internet_gateway(options = {}) ⇒ EmptyStructure
-
#disable_classic_link(options = {}) ⇒ Types::DisableVpcClassicLinkResult
-
#enable_classic_link(options = {}) ⇒ Types::EnableVpcClassicLinkResult
-
#modify_attribute(options = {}) ⇒ EmptyStructure
-
#request_vpc_peering_connection(options = {}) ⇒ VpcPeeringConnection
Associations collapse
-
#accepted_vpc_peering_connections(options = {}) ⇒ VpcPeeringConnection::Collection
-
#dhcp_options ⇒ DhcpOptions?
-
#instances(options = {}) ⇒ Instance::Collection
-
#internet_gateways(options = {}) ⇒ InternetGateway::Collection
-
#network_acls(options = {}) ⇒ NetworkAcl::Collection
-
#network_interfaces(options = {}) ⇒ NetworkInterface::Collection
-
#requested_vpc_peering_connections(options = {}) ⇒ VpcPeeringConnection::Collection
-
#route_tables(options = {}) ⇒ RouteTable::Collection
-
#security_groups(options = {}) ⇒ SecurityGroup::Collection
-
#subnets(options = {}) ⇒ Subnet::Collection
Instance Method Summary collapse
-
#client ⇒ Client
-
#data ⇒ Types::Vpc
Returns the data for this Vpc.
-
#data_loaded? ⇒ Boolean
Returns
true
if this resource is loaded. -
#exists?(options = {}) ⇒ Boolean
Returns
true
if the Vpc exists. -
#initialize(*args) ⇒ Vpc
constructor
A new instance of Vpc.
- #load ⇒ self (also: #reload)
-
#wait_until(options = {}) {|resource| ... } ⇒ Resource
deprecated
Deprecated.
Use [Aws::EC2::Client] #wait_until instead
-
#wait_until_available(options = {}, &block) ⇒ Vpc
-
#wait_until_exists(options = {}, &block) ⇒ Vpc
Constructor Details
#initialize(id, options = {}) ⇒ Vpc #initialize(options = {}) ⇒ Vpc
Returns a new instance of Vpc.
22 23 24 25 26 27 28 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 22 def initialize(*args) = Hash === args.last ? args.pop.dup : {} @id = extract_id(args, ) @data = .delete(:data) @client = .delete(:client) || Client.new() @waiter_block_warned = false end |
Instance Method Details
#accepted_vpc_peering_connections(options = {}) ⇒ VpcPeeringConnection::Collection
896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 896 def accepted_vpc_peering_connections( = {}) batches = Enumerator.new do |y| = Aws::Util.deep_merge(, filters: [{ name: "accepter-vpc-info.vpc-id", values: [@id] }]) resp = @client.describe_vpc_peering_connections() resp.each_page do |page| batch = [] page.data.vpc_peering_connections.each do |v| batch << VpcPeeringConnection.new( id: v.vpc_peering_connection_id, data: v, client: @client ) end y.yield(batch) end end VpcPeeringConnection::Collection.new(batches) end |
#associate_dhcp_options(options = {}) ⇒ EmptyStructure
290 291 292 293 294 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 290 def ( = {}) = .merge(vpc_id: @id) resp = @client.() resp.data end |
#attach_classic_link_instance(options = {}) ⇒ Types::AttachClassicLinkVpcResult
316 317 318 319 320 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 316 def attach_classic_link_instance( = {}) = .merge(vpc_id: @id) resp = @client.attach_classic_link_vpc() resp.data end |
#attach_internet_gateway(options = {}) ⇒ EmptyStructure
337 338 339 340 341 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 337 def attach_internet_gateway( = {}) = .merge(vpc_id: @id) resp = @client.attach_internet_gateway() resp.data end |
#cidr_block ⇒ String
The primary IPv4 CIDR block for the VPC.
40 41 42 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 40 def cidr_block data[:cidr_block] end |
#cidr_block_association_set ⇒ Array<Types::VpcCidrBlockAssociation>
Information about the IPv4 CIDR blocks associated with the VPC.
76 77 78 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 76 def cidr_block_association_set data[:cidr_block_association_set] end |
#client ⇒ Client
95 96 97 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 95 def client @client end |
#create_network_acl(options = {}) ⇒ NetworkAcl
368 369 370 371 372 373 374 375 376 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 368 def create_network_acl( = {}) = .merge(vpc_id: @id) resp = @client.create_network_acl() NetworkAcl.new( id: resp.data.network_acl.network_acl_id, data: resp.data.network_acl, client: @client ) end |
#create_route_table(options = {}) ⇒ RouteTable
403 404 405 406 407 408 409 410 411 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 403 def create_route_table( = {}) = .merge(vpc_id: @id) resp = @client.create_route_table() RouteTable.new( id: resp.data.route_table.route_table_id, data: resp.data.route_table, client: @client ) end |
#create_security_group(options = {}) ⇒ SecurityGroup
458 459 460 461 462 463 464 465 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 458 def create_security_group( = {}) = .merge(vpc_id: @id) resp = @client.create_security_group() SecurityGroup.new( id: resp.data.group_id, client: @client ) end |
#create_subnet(options = {}) ⇒ Subnet
536 537 538 539 540 541 542 543 544 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 536 def create_subnet( = {}) = .merge(vpc_id: @id) resp = @client.create_subnet() Subnet.new( id: resp.data.subnet.subnet_id, data: resp.data.subnet, client: @client ) end |
#create_tags(options = {}) ⇒ Tag::Collection
568 569 570 571 572 573 574 575 576 577 578 579 580 581 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 568 def ( = {}) batch = [] = Aws::Util.deep_merge(, resources: [@id]) resp = @client.() [:tags].each do |t| batch << Tag.new( resource_id: @id, key: t[:key], value: t[:value], client: @client ) end Tag::Collection.new([batch], size: batch.size) end |
#data ⇒ Types::Vpc
Returns the data for this Aws::EC2::Vpc. Calls
Client#describe_vpcs if #data_loaded? is false
.
115 116 117 118 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 115 def data load unless @data @data end |
#data_loaded? ⇒ Boolean
123 124 125 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 123 def data_loaded? !!@data end |
#delete(options = {}) ⇒ EmptyStructure
640 641 642 643 644 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 640 def delete( = {}) = .merge(vpc_id: @id) resp = @client.delete_vpc() resp.data end |
#delete_tags(options = {}) ⇒ Tag::Collection
613 614 615 616 617 618 619 620 621 622 623 624 625 626 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 613 def ( = {}) batch = [] = Aws::Util.deep_merge(, resources: [@id]) resp = @client.() [:tags].each do |t| batch << Tag.new( resource_id: @id, key: t[:key], value: t[:value], client: @client ) end Tag::Collection.new([batch], size: batch.size) end |
#describe_attribute(options = {}) ⇒ Types::DescribeVpcAttributeResult
661 662 663 664 665 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 661 def describe_attribute( = {}) = .merge(vpc_id: @id) resp = @client.describe_vpc_attribute() resp.data end |
#detach_classic_link_instance(options = {}) ⇒ Types::DetachClassicLinkVpcResult
682 683 684 685 686 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 682 def detach_classic_link_instance( = {}) = .merge(vpc_id: @id) resp = @client.detach_classic_link_vpc() resp.data end |
#detach_internet_gateway(options = {}) ⇒ EmptyStructure
703 704 705 706 707 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 703 def detach_internet_gateway( = {}) = .merge(vpc_id: @id) resp = @client.detach_internet_gateway() resp.data end |
#dhcp_options ⇒ DhcpOptions?
919 920 921 922 923 924 925 926 927 928 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 919 def if data[:dhcp_options_id] DhcpOptions.new( id: data[:dhcp_options_id], client: @client ) else nil end end |
#dhcp_options_id ⇒ String
The ID of the set of DHCP options you've associated with the VPC.
46 47 48 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 46 def data[:dhcp_options_id] end |
#disable_classic_link(options = {}) ⇒ Types::DisableVpcClassicLinkResult
721 722 723 724 725 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 721 def disable_classic_link( = {}) = .merge(vpc_id: @id) resp = @client.disable_vpc_classic_link() resp.data end |
#enable_classic_link(options = {}) ⇒ Types::EnableVpcClassicLinkResult
739 740 741 742 743 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 739 def enable_classic_link( = {}) = .merge(vpc_id: @id) resp = @client.enable_vpc_classic_link() resp.data end |
#exists?(options = {}) ⇒ Boolean
Returns true
if the Vpc exists.
130 131 132 133 134 135 136 137 138 139 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 130 def exists?( = {}) begin wait_until_exists(.merge(max_attempts: 1)) true rescue Aws::Waiters::Errors::UnexpectedError => e raise e.error rescue Aws::Waiters::Errors::WaiterFailed false end end |
#id ⇒ String Also known as: vpc_id
33 34 35 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 33 def id @id end |
#instance_tenancy ⇒ String
The allowed tenancy of instances launched into the VPC.
64 65 66 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 64 def instance_tenancy data[:instance_tenancy] end |
#instances(options = {}) ⇒ Instance::Collection
1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 1236 def instances( = {}) batches = Enumerator.new do |y| = Aws::Util.deep_merge(, filters: [{ name: "vpc-id", values: [@id] }]) resp = @client.describe_instances() resp.each_page do |page| batch = [] page.data.reservations.each do |r| r.instances.each do |i| batch << Instance.new( id: i.instance_id, data: i, client: @client ) end end y.yield(batch) end end Instance::Collection.new(batches) end |
#internet_gateways(options = {}) ⇒ InternetGateway::Collection
1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 1306 def internet_gateways( = {}) batches = Enumerator.new do |y| = Aws::Util.deep_merge(, filters: [{ name: "attachment.vpc-id", values: [@id] }]) resp = @client.describe_internet_gateways() resp.each_page do |page| batch = [] page.data.internet_gateways.each do |i| batch << InternetGateway.new( id: i.internet_gateway_id, data: i, client: @client ) end y.yield(batch) end end InternetGateway::Collection.new(batches) end |
#ipv_6_cidr_block_association_set ⇒ Array<Types::VpcIpv6CidrBlockAssociation>
Information about the IPv6 CIDR blocks associated with the VPC.
70 71 72 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 70 def ipv_6_cidr_block_association_set data[:ipv_6_cidr_block_association_set] end |
#is_default ⇒ Boolean
Indicates whether the VPC is the default VPC.
82 83 84 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 82 def is_default data[:is_default] end |
#load ⇒ self Also known as: reload
Loads, or reloads #data for the current Aws::EC2::Vpc.
Returns self
making it possible to chain methods.
vpc.reload.data
105 106 107 108 109 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 105 def load resp = @client.describe_vpcs(vpc_ids: [@id]) @data = resp.vpcs[0] self end |
#modify_attribute(options = {}) ⇒ EmptyStructure
775 776 777 778 779 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 775 def modify_attribute( = {}) = .merge(vpc_id: @id) resp = @client.modify_vpc_attribute() resp.data end |
#network_acls(options = {}) ⇒ NetworkAcl::Collection
1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 1405 def network_acls( = {}) batches = Enumerator.new do |y| = Aws::Util.deep_merge(, filters: [{ name: "vpc-id", values: [@id] }]) resp = @client.describe_network_acls() resp.each_page do |page| batch = [] page.data.network_acls.each do |n| batch << NetworkAcl.new( id: n.network_acl_id, data: n, client: @client ) end y.yield(batch) end end NetworkAcl::Collection.new(batches) end |
#network_interfaces(options = {}) ⇒ NetworkInterface::Collection
1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 1567 def network_interfaces( = {}) batches = Enumerator.new do |y| = Aws::Util.deep_merge(, filters: [{ name: "vpc-id", values: [@id] }]) resp = @client.describe_network_interfaces() resp.each_page do |page| batch = [] page.data.network_interfaces.each do |n| batch << NetworkInterface.new( id: n.network_interface_id, data: n, client: @client ) end y.yield(batch) end end NetworkInterface::Collection.new(batches) end |
#owner_id ⇒ String
The ID of the Amazon Web Services account that owns the VPC.
58 59 60 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 58 def owner_id data[:owner_id] end |
#request_vpc_peering_connection(options = {}) ⇒ VpcPeeringConnection
821 822 823 824 825 826 827 828 829 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 821 def request_vpc_peering_connection( = {}) = .merge(vpc_id: @id) resp = @client.create_vpc_peering_connection() VpcPeeringConnection.new( id: resp.data.vpc_peering_connection.vpc_peering_connection_id, data: resp.data.vpc_peering_connection, client: @client ) end |
#requested_vpc_peering_connections(options = {}) ⇒ VpcPeeringConnection::Collection
1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 1652 def requested_vpc_peering_connections( = {}) batches = Enumerator.new do |y| = Aws::Util.deep_merge(, filters: [{ name: "requester-vpc-info.vpc-id", values: [@id] }]) resp = @client.describe_vpc_peering_connections() resp.each_page do |page| batch = [] page.data.vpc_peering_connections.each do |v| batch << VpcPeeringConnection.new( id: v.vpc_peering_connection_id, data: v, client: @client ) end y.yield(batch) end end VpcPeeringConnection::Collection.new(batches) end |
#route_tables(options = {}) ⇒ RouteTable::Collection
1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 1767 def route_tables( = {}) batches = Enumerator.new do |y| = Aws::Util.deep_merge(, filters: [{ name: "vpc-id", values: [@id] }]) resp = @client.describe_route_tables() resp.each_page do |page| batch = [] page.data.route_tables.each do |r| batch << RouteTable.new( id: r.route_table_id, data: r, client: @client ) end y.yield(batch) end end RouteTable::Collection.new(batches) end |
#security_groups(options = {}) ⇒ SecurityGroup::Collection
1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 1903 def security_groups( = {}) batches = Enumerator.new do |y| = Aws::Util.deep_merge(, filters: [{ name: "vpc-id", values: [@id] }]) resp = @client.describe_security_groups() resp.each_page do |page| batch = [] page.data.security_groups.each do |s| batch << SecurityGroup.new( id: s.group_id, data: s, client: @client ) end y.yield(batch) end end SecurityGroup::Collection.new(batches) end |
#state ⇒ String
The current state of the VPC.
52 53 54 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 52 def state data[:state] end |
#subnets(options = {}) ⇒ Subnet::Collection
2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 2003 def subnets( = {}) batches = Enumerator.new do |y| = Aws::Util.deep_merge(, filters: [{ name: "vpc-id", values: [@id] }]) resp = @client.describe_subnets() resp.each_page do |page| batch = [] page.data.subnets.each do |s| batch << Subnet.new( id: s.subnet_id, data: s, client: @client ) end y.yield(batch) end end Subnet::Collection.new(batches) end |
#tags ⇒ Array<Types::Tag>
Any tags assigned to the VPC.
88 89 90 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 88 def data[:tags] end |
#wait_until(options = {}) {|resource| ... } ⇒ Resource
Use [Aws::EC2::Client] #wait_until instead
The waiting operation is performed on a copy. The original resource remains unchanged.
Waiter polls an API operation until a resource enters a desired state.
Basic Usage
Waiter will polls until it is successful, it fails by entering a terminal state, or until a maximum number of attempts are made.
# polls in a loop until condition is true
resource.wait_until() {|resource| condition}
Example
instance.wait_until(max_attempts:10, delay:5) do |instance|
instance.state.name == 'running'
end
Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. The waiting condition is set by passing a block to #wait_until:
# poll for ~25 seconds
resource.wait_until(max_attempts:5,delay:5) {|resource|...}
Callbacks
You can be notified before each polling attempt and before each
delay. If you throw :success
or :failure
from these callbacks,
it will terminate the waiter.
started_at = Time.now
# poll for 1 hour, instead of a number of attempts
proc = Proc.new do |attempts, response|
throw :failure if Time.now - started_at > 3600
end
# disable max attempts
instance.wait_until(before_wait:proc, max_attempts:nil) {...}
Handling Errors
When a waiter is successful, it returns the Resource. When a waiter fails, it raises an error.
begin
resource.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
attempts attempt in seconds invoked before each attempt invoked before each wait
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 255 def wait_until( = {}, &block) self_copy = self.dup attempts = 0 [:max_attempts] = 10 unless .key?(:max_attempts) [:delay] ||= 10 [:poller] = Proc.new do attempts += 1 if block.call(self_copy) [:success, self_copy] else self_copy.reload unless attempts == [:max_attempts] :retry end end Aws::Waiters::Waiter.new().wait({}) end |
#wait_until_available(options = {}, &block) ⇒ Vpc
147 148 149 150 151 152 153 154 155 156 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 147 def wait_until_available( = {}, &block) , params = () waiter = Waiters::VpcAvailable.new() yield_waiter_and_warn(waiter, &block) if block_given? waiter.wait(params.merge(vpc_ids: [@id])) Vpc.new({ id: @id, client: @client }) end |
#wait_until_exists(options = {}, &block) ⇒ Vpc
164 165 166 167 168 169 170 171 172 173 |
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb', line 164 def wait_until_exists( = {}, &block) , params = () waiter = Waiters::VpcExists.new() yield_waiter_and_warn(waiter, &block) if block_given? waiter.wait(params.merge(vpc_ids: [@id])) Vpc.new({ id: @id, client: @client }) end |