connections
Creates, updates, deletes or gets a connection resource or lists connections in a region
Overview
| Name | connections |
| Type | Resource |
| Description | Schema for AWS::CodeStarConnections::Connection resource which can be used to connect external source providers with AWS CodePipeline |
| Id | awscc.codestarconnections.connections |
Fields
- get (all properties)
- list (identifiers only)
| 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 AWS services. |
connection_name | string | The name of the connection. Connection names must be unique in an AWS user account. |
connection_status | string | The current status of the connection. |
owner_account_id | string | The name 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. |
provider_type | string | The name of the external provider where your third-party code repository is configured. You must specify either a ProviderType or a HostArn. |
host_arn | string | The host arn configured to represent the infrastructure where your third-party provider is installed. You must specify either a ProviderType or a HostArn. |
tags | array | Specifies the tags applied to a connection. |
region | string | AWS region. |
| 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 AWS services. |
region | string | AWS region. |
For more information, see AWS::CodeStarConnections::Connection.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | connections | INSERT | ConnectionName, region |
delete_resource | connections | DELETE | Identifier, region |
update_resource | connections | UPDATE | Identifier, PatchDocument, region |
list_resources | connections_list_only | SELECT | region |
get_resource | connections | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual connection.
SELECT
region,
connection_arn,
connection_name,
connection_status,
owner_account_id,
provider_type,
host_arn,
tags
FROM awscc.codestarconnections.connections
WHERE
region = '{{ region }}' AND
Identifier = '{{ connection_arn }}';
Lists all connections in a region.
SELECT
region,
connection_arn
FROM awscc.codestarconnections.connections_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new connection resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.codestarconnections.connections (
ConnectionName,
region
)
SELECT
'{{ connection_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.codestarconnections.connections (
ConnectionName,
ProviderType,
HostArn,
Tags,
region
)
SELECT
'{{ connection_name }}',
'{{ provider_type }}',
'{{ host_arn }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: connection
props:
- name: connection_name
value: '{{ connection_name }}'
- name: provider_type
value: '{{ provider_type }}'
- name: host_arn
value: '{{ host_arn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a connection resource, using stack-deploy.
/*+ update */
UPDATE awscc.codestarconnections.connections
SET PatchDocument = string('{{ {
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ connection_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.codestarconnections.connections
WHERE
Identifier = '{{ connection_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the connections resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
codestar-connections:CreateConnection,
codestar-connections:TagResource
codestar-connections:GetConnection,
codestar-connections:ListTagsForResource
codestar-connections:ListTagsForResource,
codestar-connections:TagResource,
codestar-connections:UntagResource
codestar-connections:DeleteConnection
codestar-connections:ListConnections,
codestar-connections:ListTagsForResource