connections
Creates, updates, deletes, gets or lists a connections resource.
Overview
| Name | connections |
| Type | Resource |
| Id | aws.codestar_connections.connections |
Fields
The following fields are returned by SELECT queries:
- get_connection
- list_connections
| Name | Datatype | Description |
|---|---|---|
connection_arn | string | The 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_name | string | The name of the connection. Connection names must be unique in an Amazon Web Services account. (pattern: <code>[\s\S]*</code>) |
connection_status | string | The current status of the connection. (PENDING, AVAILABLE, ERROR) |
host_arn | string | The Amazon Resource Name (ARN) of the host associated with the connection. (pattern: <code>arn:aws(-[\w]+)*:codestar-connections:.+:[0-9]{12}:host/.+</code>) |
owner_account_id | string | The 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_type | string | The name of the external provider where your third-party code repository is configured. (Bitbucket, GitHub, GitHubEnterpriseServer, GitLab, GitLabSelfManaged) |
| Name | Datatype | Description |
|---|---|---|
connections | array | A list of connections and the details for each connection, such as status, owner, and provider type. |
next_token | string | A token that can be used in the next ListConnections 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_connection | select | region | Returns the connection ARN and details such as status, owner, and provider type. | |
list_connections | select | region | Lists the connections associated with your account. | |
create_connection | insert | region, ConnectionName | 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. | |
delete_connection | delete | region | The 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_connection
- list_connections
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.codestar_connections.connections
WHERE region = '{{ region }}' -- required
;
Lists the connections associated with your account.
SELECT
connections,
next_token
FROM aws.codestar_connections.connections
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_connection
- Manifest
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.codestar_connections.connections (
ProviderType,
ConnectionName,
Tags,
HostArn,
region
)
SELECT
'{{ ProviderType }}',
'{{ ConnectionName }}' /* required */,
'{{ Tags }}',
'{{ HostArn }}',
'{{ region }}'
RETURNING
connection_arn,
tags
;
# Description fields are for documentation purposes
- name: connections
props:
- name: region
value: "{{ region }}"
description: Required parameter for the connections resource.
- name: ProviderType
value: "{{ ProviderType }}"
description: |
The name of the external provider where your third-party code repository is configured.
valid_values: ['Bitbucket', 'GitHub', 'GitHubEnterpriseServer', 'GitLab', 'GitLabSelfManaged']
- name: ConnectionName
value: "{{ ConnectionName }}"
description: |
The name of the connection to be created.
- name: Tags
description: |
The key-value pair to use when tagging the resource.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: HostArn
value: "{{ HostArn }}"
description: |
The Amazon Resource Name (ARN) of the host associated with the connection to be created.
DELETE examples
- delete_connection
The connection to be deleted.
DELETE FROM aws.codestar_connections.connections
WHERE region = '{{ region }}' --required
;