class Chef::Resource::AwsVpcPeeringConnection

An AWS peering connection, specifying which VPC to peer.

`name` is not guaranteed unique for an AWS account; therefore, Chef will store the vpc peering connection ID associated with this name in your Chef server in the data bag `data/aws_vpc_peering_connection/<name>`.

API documentation for the AWS Ruby SDK for VPC Peering Connections can be found here:

Public Instance Methods

aws_object() click to toggle source
# File lib/chef/resource/aws_vpc_peering_connection.rb, line 61
def aws_object
  driver, id = get_driver_and_id
  result = driver.ec2_resource.vpc_peering_connection(id) if id

  begin
    # try accessing it to find out if it exists
    result.requester_vpc if result
  rescue ::Aws::EC2::Errors::InvalidVpcPeeringConnectionIDNotFound
    result = nil
  end
  result
end