associate_dhcp_options
async
¶
associate_dhcp_options(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
dhcp_options_id: Optional[DefaultingDhcpOptionsId] = None,
vpc_id: Optional[VpcId] = None,
dry_run: Optional[Boolean] = None,
) -> None
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.
Parameters:
-
dhcp_options_id(Optional[DefaultingDhcpOptionsId], default:None) –The ID of the DHCP options set, or
defaultto associate no DHCP options with the VPC. -
vpc_id(Optional[VpcId], default:None) –The ID of the VPC.
-
dry_run(Optional[Boolean], default:None) –Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is
DryRunOperation. Otherwise, it isUnauthorizedOperation.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To associate a DHCP options set with a VPC This example associates the specified DHCP options set with the specified VPC.
>>> await client.associate_dhcp_options(dhcp_options_id='dopt-d9070ebb', vpc_id='vpc-a01106c2')
To associate the default DHCP options set with a VPC
This example associates the default DHCP options set with the specified VPC.
Source code in docs_src/capo_ec2/_services/async_ec2.py
4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 | |