hosts
Creates, updates, deletes or gets a host
resource or lists hosts
in a region
Overview
Name | hosts |
Type | Resource |
Description | Resource Type definition for AWS::EC2::Host |
Id | aws.ec2.hosts |
Fields
Name | Datatype | Description |
---|---|---|
host_id | string | ID of the host created. |
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. |
availability_zone | string | The Availability Zone in which to allocate the Dedicated Host. |
host_recovery | string | Indicates whether to enable or disable host recovery for the Dedicated Host. Host recovery is disabled by default. |
instance_type | string | 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. |
instance_family | string | 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. |
outpost_arn | string | The Amazon Resource Name (ARN) of the Amazon Web Services Outpost on which to allocate the Dedicated Host. |
host_maintenance | string | Automatically allocates a new dedicated host and moves your instances on to it if a degradation is detected on your current host. |
asset_id | string | The ID of the Outpost hardware asset. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AvailabilityZone, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all hosts
in a region.
SELECT
region,
host_id,
auto_placement,
availability_zone,
host_recovery,
instance_type,
instance_family,
outpost_arn,
host_maintenance,
asset_id
FROM aws.ec2.hosts
WHERE region = 'us-east-1';
Gets all properties from an individual host
.
SELECT
region,
host_id,
auto_placement,
availability_zone,
host_recovery,
instance_type,
instance_family,
outpost_arn,
host_maintenance,
asset_id
FROM aws.ec2.hosts
WHERE region = 'us-east-1' AND data__Identifier = '<HostId>';
INSERT
example
Use the following StackQL query and manifest file to create a new host
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.hosts (
AvailabilityZone,
region
)
SELECT
'{{ AvailabilityZone }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.hosts (
AutoPlacement,
AvailabilityZone,
HostRecovery,
InstanceType,
InstanceFamily,
OutpostArn,
HostMaintenance,
AssetId,
region
)
SELECT
'{{ AutoPlacement }}',
'{{ AvailabilityZone }}',
'{{ HostRecovery }}',
'{{ InstanceType }}',
'{{ InstanceFamily }}',
'{{ OutpostArn }}',
'{{ HostMaintenance }}',
'{{ AssetId }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: host
props:
- name: AutoPlacement
value: '{{ AutoPlacement }}'
- name: AvailabilityZone
value: '{{ AvailabilityZone }}'
- name: HostRecovery
value: '{{ HostRecovery }}'
- name: InstanceType
value: '{{ InstanceType }}'
- name: InstanceFamily
value: '{{ InstanceFamily }}'
- name: OutpostArn
value: '{{ OutpostArn }}'
- name: HostMaintenance
value: '{{ HostMaintenance }}'
- name: AssetId
value: '{{ AssetId }}'
DELETE
example
/*+ delete */
DELETE FROM aws.ec2.hosts
WHERE data__Identifier = '<HostId>'
AND region = 'us-east-1';
Permissions
To operate on the hosts
resource, the following permissions are required:
Create
ec2:AllocateHosts,
ec2:DescribeHosts
Read
ec2:DescribeHosts
Update
ec2:ModifyHosts,
ec2:DescribeHosts
Delete
ec2:ReleaseHosts,
ec2:DescribeHosts
List
ec2:DescribeHosts