class AWS::EC2::DHCPOptions

def associate vpc

Returns:
  • (nil) -

Parameters:
  • vpc (VPC, String) -- A {VPC} object or a vpc id string.
def associate vpc
  client_opts = {}
  client_opts[:dhcp_options_id] = dhcp_options_id
  client_opts[:vpc_id] = vpc_id_option(vpc)
  client.associate_dhcp_options(client_opts)
  nil
end

def configuration

Returns:
  • (Hash) -
def configuration
  dhcp_configuration_set.to_a.inject({}) do |config,opt|
    key = opt[:key].gsub(/-/, '_').to_sym
    values = opt[:value_set].map{|v| v[:value] }
    values = values.first if key == :domain_name
    values = values.first.to_i if key == :netbios_node_type
    config.merge(key => values)
  end
end

def delete

Returns:
  • (nil) -
def delete
  client_opts = {}
  client_opts[:dhcp_options_id] = dhcp_options_id
  client.delete_dhcp_options(client_opts)
  nil
end

def exists?

Returns:
  • (Boolean) - Returns true if the dhcp options exists.
def exists?
  begin
    get_resource
    true
  rescue Errors::InvalidDhcpOptionID::NotFound
    false
  end
end

def initialize dhcp_options_id, options = {}

Other tags:
    Api: - private
def initialize dhcp_options_id, options = {}
  @dhcp_options_id = dhcp_options_id
  super
end

def vpc_id_option vpc

def vpc_id_option vpc
  vpc.is_a?(VPC) ? vpc.vpc_id : vpc
end

def vpcs

Returns:
  • (VPCCollection) - Returns a collection that represents
def vpcs
  vpcs = VPCCollection.new(:config => config)
  vpcs.filter('dhcp-options-id', dhcp_options_id)
end