| « PreviousNext » | |
![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Associates a set of DHCP options (that you've previously created) with the specified VPC. Or, associates no DHCP options with the VPC.
After you associate the options with the VPC, any existing instances and all new instances that you launch in that VPC use the options. You don't need to restart or relaunch the instances. They automatically pick up the changes within a few hours, depending on how frequently the instance renews its DHCP lease. If you want, you can explicitly renew the lease using the operating system on the instance.
For more information about the supported DHCP options and using them with a VPC, see Using DHCP Options in Your VPC in the Amazon Virtual Private Cloud User Guide.
DhcpOptionsIdThe ID of the DHCP options you want to associate with the VPC, or
default if you want the VPC to use no DHCP options.
Type: String
Default: None
Required: Yes
VpcIdThe ID of the VPC to associate the DHCP options with.
Type: String
Default: None
Required: Yes
The following elements are returned in an
AssociateDhcpOptionsResponse element.
requestIdThe ID of the request.
Type: xsd:string
returnReturns true if the request succeeds. Otherwise, returns an error.
Type: xsd:boolean
This example associates the DHCP options with ID dopt-7a8b9c2d with the VPC with ID vpc-1a2b3c4d.
https://ec2.amazonaws.com/?Action=AssociateDhcpOptions &DhcpOptionsId=dopt-7a8b9c2d &VpcId=vpc-1a2b3c4d &AUTHPARAMS
<AssociateDhcpOptionsResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/"> <requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId> <return>true</return> </AssociateDhcpOptionsResponse>
This example changes the VPC with ID vpc-1a2b3c4d to use no DHCP options.
https://ec2.amazonaws.com/?Action=AssociateDhcpOptions &DhcpOptionsId=default &VpcId=vpc-1a2b3c4d &AUTHPARAMS
<AssociateDhcpOptionsResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/"> <requestId>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</requestId> <return>true</return> </AssociateDhcpOptionsResponse>