modify_hosts
¶
modify_hosts(
*,
config_overrides: Optional[EC2ClientConfig] = None,
host_recovery: Optional[HostRecovery] = None,
instance_type: Optional[String] = None,
instance_family: Optional[String] = None,
host_maintenance: Optional[HostMaintenance] = None,
host_ids: Optional[RequestHostIdList] = None,
auto_placement: Optional[AutoPlacement] = None,
) -> ModifyHostsResult
Modify the auto-placement setting of a Dedicated Host. When auto-placement is enabled, any instances that you launch with a tenancy of host but without a specific host ID are placed onto any available Dedicated Host in your account that has auto-placement enabled. When auto-placement is disabled, you need to provide a host ID to have the instance launch onto a specific host. If no host ID is provided, the instance is launched onto a suitable host with auto-placement enabled.
You can also use this API action to modify a Dedicated Host to support either multiple instance types in an instance family, or to support a specific instance type only.
Parameters:
-
host_recovery(Optional[HostRecovery], default:None) –Indicates whether to enable or disable host recovery for the Dedicated Host. For more information, see Host recovery in the Amazon EC2 User Guide.
-
instance_type(Optional[String], default:None) –Specifies the instance type to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support only a specific instance type.
If you want to modify a Dedicated Host to support multiple instance types in its current instance family, omit this parameter and specify InstanceFamily instead. You cannot specify InstanceType and InstanceFamily in the same request.
-
instance_family(Optional[String], default:None) –Specifies the instance family to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support multiple instance types within its current instance family.
If you want to modify a Dedicated Host to support a specific instance type only, omit this parameter and specify InstanceType instead. You cannot specify InstanceFamily and InstanceType in the same request.
-
host_maintenance(Optional[HostMaintenance], default:None) –Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see Host maintenance in the Amazon EC2 User Guide.
-
host_ids(Optional[RequestHostIdList], default:None) –The IDs of the Dedicated Hosts to modify.
-
auto_placement(Optional[AutoPlacement], default:None) –Specify whether to enable or disable auto-placement.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/ec2.py
49803 49804 49805 49806 49807 49808 49809 49810 49811 49812 49813 49814 49815 49816 49817 49818 49819 49820 49821 49822 49823 49824 49825 49826 49827 49828 49829 49830 49831 49832 49833 49834 49835 49836 49837 49838 49839 49840 49841 49842 49843 49844 49845 49846 49847 49848 49849 49850 49851 49852 49853 49854 49855 49856 49857 49858 49859 49860 49861 49862 49863 49864 49865 49866 49867 | |