associateDhcpOptions
abstract suspend fun associateDhcpOptions(input: AssociateDhcpOptionsRequest): AssociateDhcpOptionsResponse
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 option sets in the Amazon VPC User Guide.
Samples
fun main() {
//sampleStart
// This example associates the specified DHCP options set with the specified VPC.
ec2Client.associateDhcpOptions {
dhcpOptionsId = "dopt-d9070ebb"
vpcId = "vpc-a01106c2"
}
//sampleEnd
}
fun main() {
//sampleStart
// This example associates the default DHCP options set with the specified VPC.
ec2Client.associateDhcpOptions {
dhcpOptionsId = "default"
vpcId = "vpc-a01106c2"
}
//sampleEnd
}