Skip to main content

hosts

Creates, updates, deletes, gets or lists a hosts resource.

Overview

Namehosts
TypeResource
Idaws.codeconnections.hosts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the requested host. (pattern: <code>.*</code>)
provider_endpointstringThe endpoint of the infrastructure represented by the requested host. (pattern: <code>.*</code>)
provider_typestringThe provider type of the requested host, such as GitHub Enterprise Server. (Bitbucket, GitHub, GitHubEnterpriseServer, GitLab, GitLabSelfManaged, AzureDevOps)
statusstringThe status of the requested host. (pattern: <code>.*</code>)
vpc_configurationobjectThe VPC configuration of the requested host.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_hostselectregionReturns the host ARN and details such as status, provider type, endpoint, and, if applicable, the VPC configuration.
list_hostsselectregionLists the hosts associated with your account.
create_hostinsertregion, ProviderType, ProviderEndpointCreates 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_hostupdateregion, HostArnUpdates a specified host with the provided configurations.
delete_hostdeleteregionThe 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

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
;