

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::EC2::Host
<a name="aws-resource-ec2-host"></a>

Allocates a fully dedicated physical server for launching EC2 instances. Because the host is fully dedicated for your use, it can help you address compliance requirements and reduce costs by allowing you to use your existing server-bound software licenses. For more information, see [ Dedicated Hosts](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html) in the *Amazon EC2 User Guide*.

## Syntax
<a name="aws-resource-ec2-host-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-ec2-host-syntax.json"></a>

```
{
  "Type" : "AWS::EC2::Host",
  "Properties" : {
      "[AssetId](#cfn-ec2-host-assetid)" : String,
      "[AutoPlacement](#cfn-ec2-host-autoplacement)" : String,
      "[AvailabilityZone](#cfn-ec2-host-availabilityzone)" : String,
      "[HostMaintenance](#cfn-ec2-host-hostmaintenance)" : String,
      "[HostRecovery](#cfn-ec2-host-hostrecovery)" : String,
      "[InstanceFamily](#cfn-ec2-host-instancefamily)" : String,
      "[InstanceType](#cfn-ec2-host-instancetype)" : String,
      "[OutpostArn](#cfn-ec2-host-outpostarn)" : String,
      "[Tags](#cfn-ec2-host-tags)" : [ Tag, ... ]
    }
}
```

### YAML
<a name="aws-resource-ec2-host-syntax.yaml"></a>

```
Type: AWS::EC2::Host
Properties:
  [AssetId](#cfn-ec2-host-assetid): String
  [AutoPlacement](#cfn-ec2-host-autoplacement): String
  [AvailabilityZone](#cfn-ec2-host-availabilityzone): String
  [HostMaintenance](#cfn-ec2-host-hostmaintenance): String
  [HostRecovery](#cfn-ec2-host-hostrecovery): String
  [InstanceFamily](#cfn-ec2-host-instancefamily): String
  [InstanceType](#cfn-ec2-host-instancetype): String
  [OutpostArn](#cfn-ec2-host-outpostarn): String
  [Tags](#cfn-ec2-host-tags): 
    - Tag
```

## Properties
<a name="aws-resource-ec2-host-properties"></a>

`AssetId`  <a name="cfn-ec2-host-assetid"></a>
The ID of the Outpost hardware asset on which the Dedicated Host is allocated.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`AutoPlacement`  <a name="cfn-ec2-host-autoplacement"></a>
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](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding) in the *Amazon EC2 User Guide*.  
Default: `off`  
*Required*: No  
*Type*: String  
*Allowed values*: `on | off`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`AvailabilityZone`  <a name="cfn-ec2-host-availabilityzone"></a>
The Availability Zone in which to allocate the Dedicated Host.  
*Required*: Yes  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`HostMaintenance`  <a name="cfn-ec2-host-hostmaintenance"></a>
Indicates whether host maintenance is enabled or disabled for the Dedicated Host.  
*Required*: No  
*Type*: String  
*Allowed values*: `on | off`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`HostRecovery`  <a name="cfn-ec2-host-hostrecovery"></a>
Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. For more information, see [ Host recovery](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html) in the *Amazon EC2 User Guide*.  
Default: `off`  
*Required*: No  
*Type*: String  
*Allowed values*: `on | off`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`InstanceFamily`  <a name="cfn-ec2-host-instancefamily"></a>
The instance family supported by the Dedicated Host. For example, `m5`.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`InstanceType`  <a name="cfn-ec2-host-instancetype"></a>
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.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`OutpostArn`  <a name="cfn-ec2-host-outpostarn"></a>
The Amazon Resource Name (ARN) of the AWS Outpost on which the Dedicated Host is allocated.  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`Tags`  <a name="cfn-ec2-host-tags"></a>
Any tags assigned to the Dedicated Host.  
*Required*: No  
*Type*: Array of [Tag](aws-properties-ec2-host-tag.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## Return values
<a name="aws-resource-ec2-host-return-values"></a>

### Ref
<a name="aws-resource-ec2-host-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the host ID, such as `h-0ab123c45d67ef89`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-ec2-host-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-ec2-host-return-values-fn--getatt-fn--getatt"></a>

`HostId`  <a name="HostId-fn::getatt"></a>
The ID of the host.

## Examples
<a name="aws-resource-ec2-host--examples"></a>

### Allocate a Dedicated Host
<a name="aws-resource-ec2-host--examples--Allocate_a_Dedicated_Host"></a>

The following example allocates a dedicated host for `c3.large` instances in the `us-east-1a` Availability Zone.

#### JSON
<a name="aws-resource-ec2-host--examples--Allocate_a_Dedicated_Host--json"></a>

```
"Host" : {
  "Type" : "AWS::EC2::Host",
  "Properties" : {
    "AutoPlacement" : "on",
    "AvailabilityZone" : "us-east-1a",
    "InstanceType" : "c3.large"
  }
}
```

#### YAML
<a name="aws-resource-ec2-host--examples--Allocate_a_Dedicated_Host--yaml"></a>

```
Host:
  Type: AWS::EC2::Host
  Properties: 
    AutoPlacement: on
    AvailabilityZone: us-east-1a
    InstanceType: c3.large
```

# AWS::EC2::Host Tag
<a name="aws-properties-ec2-host-tag"></a>

Any tags assigned to the Dedicated Host.

## Syntax
<a name="aws-properties-ec2-host-tag-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-ec2-host-tag-syntax.json"></a>

```
{
  "[Key](#cfn-ec2-host-tag-key)" : String,
  "[Value](#cfn-ec2-host-tag-value)" : String
}
```

### YAML
<a name="aws-properties-ec2-host-tag-syntax.yaml"></a>

```
  [Key](#cfn-ec2-host-tag-key): String
  [Value](#cfn-ec2-host-tag-value): String
```

## Properties
<a name="aws-properties-ec2-host-tag-properties"></a>

`Key`  <a name="cfn-ec2-host-tag-key"></a>
The key of the tag.  
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with `aws:`.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Value`  <a name="cfn-ec2-host-tag-value"></a>
The value of the tag.  
Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.  
*Required*: Yes  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)