environment_hosts
Creates, updates, deletes, gets or lists an environment_hosts resource.
Overview
| Name | environment_hosts |
| Type | Resource |
| Id | aws.evs.environment_hosts |
Fields
The following fields are returned by SELECT queries:
- list_environment_hosts
| Name | Datatype | Description |
|---|---|---|
created_at | string (date-time) | The date and time that the host was created. |
dedicated_host_id | string | The unique ID of the Amazon EC2 Dedicated Host. (pattern: <code>h-[a-f0-9]{8}([a-f0-9]{9})?</code>) |
ec_2_instance_id | string | The unique ID of the EC2 instance that represents the host. |
host_name | string | The DNS hostname of the host. DNS hostnames for hosts must be unique across Amazon EVS environments and within VCF. (pattern: <code>([a-zA-Z0-9-]*)</code>) |
host_state | string | The state of the host. (CREATING, CREATED, UPDATING, DELETING, DELETED, CREATE_FAILED, UPDATE_FAILED) |
instance_type | string | The EC2 instance type of the host. EC2 instances created through Amazon EVS do not support associating an IAM instance profile. (i4i.metal, i7i.metal-24xl) |
ip_address | string | The IP address of the host. (pattern: <code>(\d{1,3}.){3}\d{1,3}</code>) |
key_name | string | The name of the SSH key that is used to access the host. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
modified_at | string (date-time) | The date and time that the host was modified. |
network_interfaces | array | The elastic network interfaces that are attached to the host. |
placement_group_id | string | The unique ID of the placement group where the host is placed. (pattern: <code>pg-[a-f0-9]{8}([a-f0-9]{9})?</code>) |
state_details | string | A detailed description of the hostState of a host. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_environment_hosts | select | region | List the hosts within an environment. | |
create_environment_host | insert | region, environmentId, host | Creates an ESX host and adds it to an Amazon EVS environment. This action can only be used after the Amazon EVS environment is deployed. You can use the dedicatedHostId parameter to specify an Amazon EC2 Dedicated Host for ESX host creation. You can use the placementGroupId parameter to specify a cluster or partition placement group to launch EC2 instances into. If you don't specify an ESX version when adding hosts using CreateEnvironmentHost action, Amazon EVS automatically uses the default ESX version for your environment's VCF version. To find the available ESX versions for a particular VCF version, use the GetVersions action. You cannot use the dedicatedHostId and placementGroupId parameters together in the same CreateEnvironmentHost action. This results in a ValidationException response. | |
delete_environment_host | delete | region | Deletes a host from an Amazon EVS environment. Before deleting a host, you must unassign and decommission the host from within the SDDC Manager user interface. Not doing so could impact the availability of your virtual machines or result in data loss. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- list_environment_hosts
List the hosts within an environment.
SELECT
created_at,
dedicated_host_id,
ec_2_instance_id,
host_name,
host_state,
instance_type,
ip_address,
key_name,
modified_at,
network_interfaces,
placement_group_id,
state_details
FROM aws.evs.environment_hosts
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_environment_host
- Manifest
Creates an ESX host and adds it to an Amazon EVS environment. This action can only be used after the Amazon EVS environment is deployed. You can use the dedicatedHostId parameter to specify an Amazon EC2 Dedicated Host for ESX host creation. You can use the placementGroupId parameter to specify a cluster or partition placement group to launch EC2 instances into. If you don't specify an ESX version when adding hosts using CreateEnvironmentHost action, Amazon EVS automatically uses the default ESX version for your environment's VCF version. To find the available ESX versions for a particular VCF version, use the GetVersions action. You cannot use the dedicatedHostId and placementGroupId parameters together in the same CreateEnvironmentHost action. This results in a ValidationException response.
INSERT INTO aws.evs.environment_hosts (
clientToken,
environmentId,
host,
esxVersion,
region
)
SELECT
'{{ clientToken }}',
'{{ environmentId }}' /* required */,
'{{ host }}' /* required */,
'{{ esxVersion }}',
'{{ region }}'
RETURNING
environment_summary,
host
;
# Description fields are for documentation purposes
- name: environment_hosts
props:
- name: region
value: "{{ region }}"
description: Required parameter for the environment_hosts resource.
- name: clientToken
value: "{{ clientToken }}"
description: |
This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect. A unique, case-sensitive identifier that you provide to ensure the idempotency of the host creation request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.
- name: environmentId
value: "{{ environmentId }}"
description: |
A unique ID for the environment that the host is added to.
- name: host
description: |
An object that represents a host. You cannot use dedicatedHostId and placementGroupId together in the same HostInfoForCreateobject. This results in a ValidationException response.
value:
hostName: "{{ hostName }}"
keyName: "{{ keyName }}"
instanceType: "{{ instanceType }}"
placementGroupId: "{{ placementGroupId }}"
dedicatedHostId: "{{ dedicatedHostId }}"
- name: esxVersion
value: "{{ esxVersion }}"
description: |
The ESX version to use for the host.
DELETE examples
- delete_environment_host
Deletes a host from an Amazon EVS environment. Before deleting a host, you must unassign and decommission the host from within the SDDC Manager user interface. Not doing so could impact the availability of your virtual machines or result in data loss.
DELETE FROM aws.evs.environment_hosts
WHERE region = '{{ region }}' --required
;