Skip to main content

connections

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

Overview

Nameconnections
TypeResource
Idaws.codeconnections.connections

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
connection_arnstringThe Amazon Resource Name (ARN) of the connection. The ARN is used as the connection reference when the connection is shared between Amazon Web Services services. The ARN is never reused if the connection is deleted. (pattern: <code>arn:aws(-[\w]+)*:.+:.+:[0-9]{12}:.+</code>)
connection_namestringThe name of the connection. Connection names must be unique in an Amazon Web Services account. (pattern: <code>[\s\S]*</code>)
connection_statusstringThe current status of the connection. (PENDING, AVAILABLE, ERROR)
host_arnstringThe Amazon Resource Name (ARN) of the host associated with the connection. (pattern: <code>arn:aws(-[\w]+)*:(codestar-connections|codeconnections):.+:[0-9]{12}:host/.+</code>)
owner_account_idstringThe identifier of the external provider where your third-party code repository is configured. For Bitbucket, this is the account ID of the owner of the Bitbucket repository. (pattern: <code>[0-9]{12}</code>)
provider_typestringThe name of the external provider where your third-party code repository is configured. (Bitbucket, GitHub, GitHubEnterpriseServer, GitLab, GitLabSelfManaged, AzureDevOps)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_connectionselectregionReturns the connection ARN and details such as status, owner, and provider type.
list_connectionsselectregionLists the connections associated with your account.
create_connectioninsertregion, ConnectionNameCreates a connection that can then be given to other Amazon Web Services services like CodePipeline so that it can access third-party code repositories. The connection is in pending status until the third-party connection handshake is completed from the console.
delete_connectiondeleteregionThe connection to be deleted.

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 connection ARN and details such as status, owner, and provider type.

SELECT
connection_arn,
connection_name,
connection_status,
host_arn,
owner_account_id,
provider_type
FROM aws.codeconnections.connections
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a connection that can then be given to other Amazon Web Services services like CodePipeline so that it can access third-party code repositories. The connection is in pending status until the third-party connection handshake is completed from the console.

INSERT INTO aws.codeconnections.connections (
ProviderType,
ConnectionName,
Tags,
HostArn,
region
)
SELECT
'{{ ProviderType }}',
'{{ ConnectionName }}' /* required */,
'{{ Tags }}',
'{{ HostArn }}',
'{{ region }}'
RETURNING
connection_arn,
tags
;

DELETE examples

The connection to be deleted.

DELETE FROM aws.codeconnections.connections
WHERE region = '{{ region }}' --required
;