hosts
Creates, updates, deletes, gets or lists a hosts resource.
Overview
| Name | hosts |
| Type | Resource |
| Id | aws.codeconnections.hosts |
Fields
The following fields are returned by SELECT queries:
- get_host
- list_hosts
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the requested host. (pattern: <code>.*</code>) |
provider_endpoint | string | The endpoint of the infrastructure represented by the requested host. (pattern: <code>.*</code>) |
provider_type | string | The provider type of the requested host, such as GitHub Enterprise Server. (Bitbucket, GitHub, GitHubEnterpriseServer, GitLab, GitLabSelfManaged, AzureDevOps) |
status | string | The status of the requested host. (pattern: <code>.*</code>) |
vpc_configuration | object | The VPC configuration of the requested host. |
| Name | Datatype | Description |
|---|---|---|
hosts | array | A list of hosts and the details for each host, such as status, endpoint, and provider type. |
next_token | string | A token that can be used in the next ListHosts call. To view all items in the list, continue to call this operation with each subsequent token until no more nextToken values are returned. (pattern: <code>^.*$</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_host | select | region | Returns the host ARN and details such as status, provider type, endpoint, and, if applicable, the VPC configuration. | |
list_hosts | select | region | Lists the hosts associated with your account. | |
create_host | insert | region, ProviderType, ProviderEndpoint | Creates a resource that represents the infrastructure where a third-party provider is installed. The host is used when you create connections to an installed third-party provider type, such as GitHub Enterprise Server. You create one host for all connections to that provider. A host created through the CLI or the SDK is in PENDING status by default. You can make its status AVAILABLE by setting up the host in the console. | |
update_host | update | region, HostArn | Updates a specified host with the provided configurations. | |
delete_host | delete | region | The host to be deleted. Before you delete a host, all connections associated to the host must be deleted. A host cannot be deleted if it is in the VPC_CONFIG_INITIALIZING or VPC_CONFIG_DELETING state. |
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
- get_host
- list_hosts
Returns the host ARN and details such as status, provider type, endpoint, and, if applicable, the VPC configuration.
SELECT
name,
provider_endpoint,
provider_type,
status,
vpc_configuration
FROM aws.codeconnections.hosts
WHERE region = '{{ region }}' -- required
;
Lists the hosts associated with your account.
SELECT
hosts,
next_token
FROM aws.codeconnections.hosts
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_host
- Manifest
Creates a resource that represents the infrastructure where a third-party provider is installed. The host is used when you create connections to an installed third-party provider type, such as GitHub Enterprise Server. You create one host for all connections to that provider. A host created through the CLI or the SDK is in PENDING status by default. You can make its status AVAILABLE by setting up the host in the console.
INSERT INTO aws.codeconnections.hosts (
Name,
ProviderType,
ProviderEndpoint,
VpcConfiguration,
Tags,
region
)
SELECT
'{{ Name }}',
'{{ ProviderType }}' /* required */,
'{{ ProviderEndpoint }}' /* required */,
'{{ VpcConfiguration }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
host_arn,
tags
;
# Description fields are for documentation purposes
- name: hosts
props:
- name: region
value: "{{ region }}"
description: Required parameter for the hosts resource.
- name: Name
value: "{{ Name }}"
description: |
The name of the host to be created.
- name: ProviderType
value: "{{ ProviderType }}"
description: |
The name of the installed provider to be associated with your connection. The host resource represents the infrastructure where your provider type is installed. The valid provider type is GitHub Enterprise Server.
valid_values: ['Bitbucket', 'GitHub', 'GitHubEnterpriseServer', 'GitLab', 'GitLabSelfManaged', 'AzureDevOps']
- name: ProviderEndpoint
value: "{{ ProviderEndpoint }}"
description: |
The endpoint of the infrastructure to be represented by the host after it is created.
- name: VpcConfiguration
description: |
The VPC configuration to be provisioned for the host. A VPC must be configured and the infrastructure to be represented by the host must already be connected to the VPC.
value:
VpcId: "{{ VpcId }}"
SubnetIds:
- "{{ SubnetIds }}"
SecurityGroupIds:
- "{{ SecurityGroupIds }}"
TlsCertificate: "{{ TlsCertificate }}"
- name: Tags
description: |
Tags for the host to be created.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_host
Updates a specified host with the provided configurations.
UPDATE aws.codeconnections.hosts
SET
HostArn = '{{ HostArn }}',
ProviderEndpoint = '{{ ProviderEndpoint }}',
VpcConfiguration = '{{ VpcConfiguration }}'
WHERE
region = '{{ region }}' --required
AND HostArn = '{{ HostArn }}' --required;
DELETE examples
- delete_host
The host to be deleted. Before you delete a host, all connections associated to the host must be deleted. A host cannot be deleted if it is in the VPC_CONFIG_INITIALIZING or VPC_CONFIG_DELETING state.
DELETE FROM aws.codeconnections.hosts
WHERE region = '{{ region }}' --required
;