class AWS::EC2::VPCPeeringConnectionCollection
Public Instance Methods
[](vpc_peering_connection_id)
click to toggle source
Returns a reference to the VPC peering connection with the given id. vpc_peering_connection = vpc.peering_connections['vpc-peering-connection-id']
@param [String] vpc_peering_connection_id
@return [VPCPeeringConnection]
# File lib/aws/ec2/vpc_peering_connection_collection.rb, line 38 def [] vpc_peering_connection_id VPCPeeringConnection.new(vpc_peering_connection_id, :config => config) end
create(local_vpc, remote_vpc, options = {})
click to toggle source
Requests a new VPC
peering connection between the “local” VPC
and the “remote” VPC
# File lib/aws/ec2/vpc_peering_connection_collection.rb, line 21 def create local_vpc, remote_vpc, options = {} client_opts = {} client_opts[:vpc_id] = local_vpc.id client_opts[:peer_vpc_id] = remote_vpc.id resp = client.create_vpc_peering_connection(client_opts) VPCPeeringConnection.new_from(:create_vpc_peering_connection, resp.vpc_peering_connection, resp.vpc_peering_connection.vpc_peering_connection_id, :config => config) end
Protected Instance Methods
_each_item(options = {}) { |vpc_peering_connection| ... }
click to toggle source
# File lib/aws/ec2/vpc_peering_connection_collection.rb, line 44 def _each_item options = {}, &block response = filtered_request(:describe_vpc_peering_connections, options, &block) response.vpc_peering_connection_set.each do |c| vpc_peering_connection = VPCPeeringConnection.new_from(:describe_vpc_peering_connections, c, c.vpc_peering_connection_id, :config => config) yield(vpc_peering_connection) end end