allocate_hosts
¶
allocate_hosts(
*,
config_overrides: Optional[EC2ClientConfig] = None,
instance_family: Optional[String] = None,
tag_specifications: Optional[TagSpecificationList] = None,
host_recovery: Optional[HostRecovery] = None,
outpost_arn: Optional[String] = None,
host_maintenance: Optional[HostMaintenance] = None,
asset_ids: Optional[AssetIdList] = None,
availability_zone_id: Optional[AvailabilityZoneId] = None,
cpu_options: Optional[HostCpuOptionsRequest] = None,
auto_placement: Optional[AutoPlacement] = None,
client_token: Optional[String] = None,
instance_type: Optional[String] = None,
quantity: Optional[Integer] = None,
availability_zone: Optional[AvailabilityZoneName] = None,
) -> AllocateHostsResult
Allocates a Dedicated Host to your account. At a minimum, specify the supported instance type or instance family, the Availability Zone in which to allocate the host, and the number of hosts to allocate.
Parameters:
-
instance_family(Optional[String], default:None) –Specifies the instance family to be supported by the Dedicated Hosts. If you specify an instance family, the Dedicated Hosts support multiple instance types within that instance family.
If you want the Dedicated Hosts to support a specific instance type only, omit this parameter and specify InstanceType instead. You cannot specify InstanceFamily and InstanceType in the same request.
-
tag_specifications(Optional[TagSpecificationList], default:None) –The tags to apply to the Dedicated Host during creation.
-
host_recovery(Optional[HostRecovery], default:None) –Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. For more information, see Host recovery in the Amazon EC2 User Guide.
Default:
off -
outpost_arn(Optional[String], default:None) –The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host. If you specify OutpostArn, you can optionally specify AssetIds.
If you are allocating the Dedicated Host in a Region, omit this parameter.
-
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.
-
asset_ids(Optional[AssetIdList], default:None) –The IDs of the Outpost hardware assets on which to allocate the Dedicated Hosts. Targeting specific hardware assets on an Outpost can help to minimize latency between your workloads. This parameter is supported only if you specify OutpostArn. If you are allocating the Dedicated Hosts in a Region, omit this parameter.
-
If you specify this parameter, you can omit Quantity. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset.
-
If you specify both AssetIds and Quantity, then the value for Quantity must be equal to the number of asset IDs specified.
-
-
availability_zone_id(Optional[AvailabilityZoneId], default:None) –The ID of the Availability Zone.
-
cpu_options(Optional[HostCpuOptionsRequest], default:None) –The CPU configuration options to apply to the Dedicated Host.
-
auto_placement(Optional[AutoPlacement], default:None) –Indicates whether the host accepts any untargeted instance launches that match its instance type configuration, or if it only accepts Host tenancy instance launches that specify its unique host ID. For more information, see Understanding auto-placement and affinity in the Amazon EC2 User Guide.
Default:
off -
client_token(Optional[String], default:None) –Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring Idempotency.
-
instance_type(Optional[String], default:None) –Specifies the instance type to be supported by the Dedicated Hosts. If you specify an instance type, the Dedicated Hosts support instances of the specified instance type only.
If you want the Dedicated Hosts to support multiple instance types in a specific instance family, omit this parameter and specify InstanceFamily instead. You cannot specify InstanceType and InstanceFamily in the same request.
-
quantity(Optional[Integer], default:None) –The number of Dedicated Hosts to allocate to your account with these parameters. If you are allocating the Dedicated Hosts on an Outpost, and you specify AssetIds, you can omit this parameter. In this case, Amazon EC2 allocates a Dedicated Host on each specified hardware asset. If you specify both AssetIds and Quantity, then the value that you specify for Quantity must be equal to the number of asset IDs specified.
-
availability_zone(Optional[AvailabilityZoneName], default:None) –The Availability Zone in which to allocate the Dedicated Host.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/ec2.py
3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 | |