Class: Chef::Resource::AwsVpcPeeringConnection

Inherits:
Provisioning::AWSDriver::AWSResourceWithEntry show all
Defined in:
lib/chef/resource/aws_vpc_peering_connection.rb

Overview

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:

Constant Summary

Constants inherited from Provisioning::AWSDriver::AWSResource

Provisioning::AWSDriver::AWSResource::NOT_PASSED

Instance Method Summary collapse

Methods inherited from Provisioning::AWSDriver::AWSResourceWithEntry

#delete_managed_entry, #get_id_from_managed_entry, #save_managed_entry, #to_s

Methods inherited from Provisioning::AWSDriver::AWSResource

#action, #action=, #aws_object_id, get_aws_object, get_aws_object_id, #initialize, lookup_options

Methods inherited from Provisioning::AWSDriver::SuperLWRP

#_pv_is, attribute, lazy

Constructor Details

This class inherits a constructor from Chef::Provisioning::AWSDriver::AWSResource

Instance Method Details

#aws_objectObject



61
62
63
64
65
66
67
68
69
70
71
72
# 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