associate_dhcp_options ( $dhcp_options_id, $vpc_id, $opt )

Associates a set of DHCP options (that you’ve previously created) with the specified VPC. Or, associates the default DHCP options with the VPC. The default set consists of the standard EC2 host name, no domain name, no DNS server, no NTP server, and no NetBIOS server or node type. After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. For more information about the supported DHCP options and using them with Amazon VPC, go to Using DHCP Options in the Amazon Virtual Private Cloud Developer Guide.

Access

public

Parameters

Parameter

Type

Required

Description

$dhcp_options_id

string

Required

The ID of the DHCP options to associate with the VPC. Specify “default” to associate the default DHCP options with the VPC.

$vpc_id

string

Required

The ID of the VPC to associate the DHCP options with.

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Associate a set of DHCP options with a VPC.

$ec2 = new AmazonEC2();

$response = $ec2->associate_dhcp_options('dopt-2a7ad743', 'vpc-abcd1234');

var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/ec2.class.php | Toggle source view (8 lines) | View on GitHub

public function associate_dhcp_options($dhcp_options_id, $vpc_id, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['DhcpOptionsId'] = $dhcp_options_id;
    $opt['VpcId'] = $vpc_id;
    
    return $this->authenticate('AssociateDhcpOptions', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback