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. You can explicitly renew the lease using the operating system on the instance.
For more information, see DHCP options sets
in the Amazon Virtual Private Cloud User Guide.
example
Use a bare-bones client and the command you need to make an API call.
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. You can explicitly renew the lease using the operating system on the instance.
For more information, see DHCP options sets in the Amazon Virtual Private Cloud User Guide.
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, AssociateDhcpOptionsCommand } from "@aws-sdk/client-ec2"; // ES Modules import // const { EC2Client, AssociateDhcpOptionsCommand } = require("@aws-sdk/client-ec2"); // CommonJS import const client = new EC2Client(config); const command = new AssociateDhcpOptionsCommand(input); const response = await client.send(command);
AssociateDhcpOptionsCommandInput for command's
input
shape.AssociateDhcpOptionsCommandOutput for command's
response
shape.config for EC2Client's
config
shape.