Table Of Contents


User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . ec2 ]



Allocates a Dedicated Host to your account. At a minimum, specify the instance size type, Availability Zone, and quantity of hosts to allocate.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


[--auto-placement <value>]
--availability-zone <value>
[--client-token <value>]
--instance-type <value>
--quantity <value>
[--tag-specifications <value>]
[--host-recovery <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--auto-placement (string)

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 Instance Placement and Host Affinity in the Amazon EC2 User Guide for Linux Instances .

Default: on

Possible values:

  • on
  • off

--availability-zone (string)

The Availability Zone in which to allocate the Dedicated Host.

--client-token (string)

Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency .

--instance-type (string)

Specifies the instance type for which to configure your Dedicated Hosts. When you specify the instance type, that is the only instance type that you can launch onto that host.

--quantity (integer)

The number of Dedicated Hosts to allocate to your account with these parameters.

--tag-specifications (list)

The tags to apply to the Dedicated Host during creation.

Shorthand Syntax:

ResourceType=string,Tags=[{Key=string,Value=string},{Key=string,Value=string}] ...

JSON Syntax:

    "ResourceType": "client-vpn-endpoint"|"customer-gateway"|"dedicated-host"|"dhcp-options"|"elastic-ip"|"fleet"|"fpga-image"|"host-reservation"|"image"|"instance"|"internet-gateway"|"launch-template"|"natgateway"|"network-acl"|"network-interface"|"reserved-instances"|"route-table"|"security-group"|"snapshot"|"spot-instances-request"|"subnet"|"traffic-mirror-filter"|"traffic-mirror-session"|"traffic-mirror-target"|"transit-gateway"|"transit-gateway-attachment"|"transit-gateway-route-table"|"volume"|"vpc"|"vpc-peering-connection"|"vpn-connection"|"vpn-gateway",
    "Tags": [
        "Key": "string",
        "Value": "string"

--host-recovery (string)

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 Elastic Compute Cloud User Guide .

Default: off

Possible values:

  • on
  • off

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.


To allocate a Dedicated host to your account

This example allocates a single Dedicated host in a specific Availability Zone, onto which you can launch m3.medium instances, to your account.


aws ec2 allocate-hosts --instance-type m3.medium --availability-zone us-east-1b --quantity 1


    "HostIds": [


HostIds -> (list)

The ID of the allocated Dedicated Host. This is used to launch an instance onto a specific host.