Class: Chef::Resource::AwsVpc

Overview

Represents an AWS VPC.

This allows you to finely control network access and security for your instances, creating a “walled garden” which cannot be accessed by the Internet (or get out to it) without explicitly enabling it through subnets, route tables, internet gateways and NATs.

VPCs and network security are closely related with the following other resources:

  • ‘aws_subnet`: sub-sections of a VPC that can be walled off from each other, which actually contain instances

  • ‘aws_security_group`: descriptions of instances–particularly, who can talk to them and who they can talk to.

  • ‘aws_route_table`: descriptions of where traffic should be routed when an instance in a subnet tries to talk to a particular IP.

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

General documentation on AWS VPCs can be found here:

API documentation for the AWS Ruby SDK for VPCs (and the object returned from ‘aws_object` can be found here:

Constant Summary

Constants inherited from Provisioning::AWSDriver::AWSResource

Provisioning::AWSDriver::AWSResource::NOT_PASSED

Instance Method Summary collapse

Methods included from Provisioning::AWSDriver::AWSTaggable

included

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



135
136
137
138
139
# File 'lib/chef/resource/aws_vpc.rb', line 135

def aws_object
  driver, id = get_driver_and_id
  result = driver.ec2.vpcs[id] if id
  result && result.exists? ? result : nil
end