repository_links
Creates, updates, deletes or gets a repository_link resource or lists repository_links in a region
Overview
| Name | repository_links |
| Type | Resource |
| Description | Schema for AWS::CodeStarConnections::RepositoryLink resource which is used to aggregate repository metadata relevant to synchronizing source provider content to AWS Resources. |
| Id | awscc.codestarconnections.repository_links |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
connection_arn | string | The Amazon Resource Name (ARN) of the CodeStarConnection. The ARN is used as the connection reference when the connection is shared between AWS services. |
provider_type | string | The name of the external provider where your third-party code repository is configured. |
owner_id | string | the ID of the entity that owns the repository. |
repository_name | string | The repository for which the link is being created. |
encryption_key_arn | string | The ARN of the KMS key that the customer can optionally specify to use to encrypt RepositoryLink properties. If not specified, a default key will be used. |
repository_link_id | string | A UUID that uniquely identifies the RepositoryLink. |
repository_link_arn | string | A unique Amazon Resource Name (ARN) to designate the repository link. |
tags | array | Specifies the tags applied to a RepositoryLink. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
repository_link_arn | string | A unique Amazon Resource Name (ARN) to designate the repository link. |
region | string | AWS region. |
For more information, see AWS::CodeStarConnections::RepositoryLink.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | repository_links | INSERT | RepositoryName, ConnectionArn, OwnerId, region |
delete_resource | repository_links | DELETE | Identifier, region |
update_resource | repository_links | UPDATE | Identifier, PatchDocument, region |
list_resources | repository_links_list_only | SELECT | region |
get_resource | repository_links | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual repository_link.
SELECT
region,
connection_arn,
provider_type,
owner_id,
repository_name,
encryption_key_arn,
repository_link_id,
repository_link_arn,
tags
FROM awscc.codestarconnections.repository_links
WHERE
region = '{{ region }}' AND
Identifier = '{{ repository_link_arn }}';
Lists all repository_links in a region.
SELECT
region,
repository_link_arn
FROM awscc.codestarconnections.repository_links_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new repository_link resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.codestarconnections.repository_links (
ConnectionArn,
OwnerId,
RepositoryName,
region
)
SELECT
'{{ connection_arn }}',
'{{ owner_id }}',
'{{ repository_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.codestarconnections.repository_links (
ConnectionArn,
OwnerId,
RepositoryName,
EncryptionKeyArn,
Tags,
region
)
SELECT
'{{ connection_arn }}',
'{{ owner_id }}',
'{{ repository_name }}',
'{{ encryption_key_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: repository_link
props:
- name: connection_arn
value: '{{ connection_arn }}'
- name: owner_id
value: '{{ owner_id }}'
- name: repository_name
value: '{{ repository_name }}'
- name: encryption_key_arn
value: '{{ encryption_key_arn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a repository_link resource, using stack-deploy.
/*+ update */
UPDATE awscc.codestarconnections.repository_links
SET PatchDocument = string('{{ {
"ConnectionArn": connection_arn,
"EncryptionKeyArn": encryption_key_arn,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ repository_link_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.codestarconnections.repository_links
WHERE
Identifier = '{{ repository_link_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 repository_links resource, the following permissions are required:
- Update
- Create
- Read
- Delete
- List
codestar-connections:GetConnection,
codestar-connections:ListTagsForResource,
codestar-connections:PassConnection,
codestar-connections:UseConnection,
codestar-connections:TagResource,
codestar-connections:UntagResource,
codestar-connections:UpdateRepositoryLink
codestar-connections:CreateRepositoryLink,
codestar-connections:TagResource,
codestar-connections:UseConnection,
codestar-connections:PassConnection,
codestar-connections:GetConnection,
iam:CreateServiceLinkedRole
codestar-connections:GetRepositoryLink,
codestar-connections:ListTagsForResource,
codestar-connections:GetConnection
codestar-connections:GetRepositoryLink,
codestar-connections:DeleteRepositoryLink,
codestar-connections:GetConnection
codestar-connections:ListRepositoryLinks,
codestar-connections:ListTagsForResource