AWS::EC2::Host
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 in the Amazon EC2 User Guide.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::EC2::Host", "Properties" : { "AssetId" :
String
, "AutoPlacement" :String
, "AvailabilityZone" :String
, "HostMaintenance" :String
, "HostRecovery" :String
, "InstanceFamily" :String
, "InstanceType" :String
, "OutpostArn" :String
} }
YAML
Type: AWS::EC2::Host Properties: AssetId:
String
AutoPlacement:String
AvailabilityZone:String
HostMaintenance:String
HostRecovery:String
InstanceFamily:String
InstanceType:String
OutpostArn:String
Properties
AssetId
-
The ID of the Outpost hardware asset on which the Dedicated Host is allocated.
Required: No
Type: String
Update requires: Replacement
AutoPlacement
-
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
Required: No
Type: String
Allowed values:
on | off
Update requires: No interruption
AvailabilityZone
-
The Availability Zone in which to allocate the Dedicated Host.
Required: Yes
Type: String
Update requires: Replacement
HostMaintenance
-
Indicates whether host maintenance is enabled or disabled for the Dedicated Host.
Required: No
Type: String
Allowed values:
on | off
Update requires: No interruption
HostRecovery
-
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
Required: No
Type: String
Allowed values:
on | off
Update requires: No interruption
InstanceFamily
-
The instance family supported by the Dedicated Host. For example,
m5
.Required: No
Type: String
Update requires: Replacement
InstanceType
-
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
OutpostArn
-
The Amazon Resource Name (ARN) of the AWS Outpost on which the Dedicated Host is allocated.
Required: No
Type: String
Update requires: Replacement
Return values
Ref
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 Ref
.
Fn::GetAtt
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 Fn::GetAtt
.
HostId
-
The ID of the host.
Examples
Allocate a Dedicated Host
The following example allocates a dedicated host for c3.large
instances in the us-east-1a
Availability Zone.
JSON
"Host" : { "Type" : "AWS::EC2::Host", "Properties" : { "AutoPlacement" : "on", "AvailabilityZone" : "us-east-1a", "InstanceType" : "c3.large" } }
YAML
Host: Type: AWS::EC2::Host Properties: AutoPlacement: on AvailabilityZone: us-east-1a InstanceType: c3.large