repository_associations
Creates, updates, deletes or gets a repository_association resource or lists repository_associations in a region
Overview
| Name | repository_associations |
| Type | Resource |
| Description | This resource schema represents the RepositoryAssociation resource in the Amazon CodeGuru Reviewer service. |
| Id | awscc.codegurureviewer.repository_associations |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the repository to be associated. |
type | string | The type of repository to be associated. |
owner | string | The owner of the repository. For a Bitbucket repository, this is the username for the account that owns the repository. |
bucket_name | string | The name of the S3 bucket associated with an associated S3 repository. It must start with codeguru-reviewer-. |
connection_arn | string | The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection. |
association_arn | string | The Amazon Resource Name (ARN) of the repository association. |
tags | array | The tags associated with a repository association. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
association_arn | string | The Amazon Resource Name (ARN) of the repository association. |
region | string | AWS region. |
For more information, see AWS::CodeGuruReviewer::RepositoryAssociation.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | repository_associations | INSERT | Name, Type, region |
delete_resource | repository_associations | DELETE | Identifier, region |
list_resources | repository_associations_list_only | SELECT | region |
get_resource | repository_associations | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual repository_association.
SELECT
region,
name,
type,
owner,
bucket_name,
connection_arn,
association_arn,
tags
FROM awscc.codegurureviewer.repository_associations
WHERE
region = '{{ region }}' AND
Identifier = '{{ association_arn }}';
Lists all repository_associations in a region.
SELECT
region,
association_arn
FROM awscc.codegurureviewer.repository_associations_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new repository_association resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.codegurureviewer.repository_associations (
Name,
Type,
region
)
SELECT
'{{ name }}',
'{{ type }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.codegurureviewer.repository_associations (
Name,
Type,
Owner,
BucketName,
ConnectionArn,
Tags,
region
)
SELECT
'{{ name }}',
'{{ type }}',
'{{ owner }}',
'{{ bucket_name }}',
'{{ connection_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_association
props:
- name: name
value: '{{ name }}'
- name: type
value: '{{ type }}'
- name: owner
value: '{{ owner }}'
- name: bucket_name
value: '{{ bucket_name }}'
- name: connection_arn
value: '{{ connection_arn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
DELETE example
/*+ delete */
DELETE FROM awscc.codegurureviewer.repository_associations
WHERE
Identifier = '{{ association_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_associations resource, the following permissions are required:
- Create
- Read
- Delete
- List
codeguru-reviewer:DescribeRepositoryAssociation,
codeguru-reviewer:AssociateRepository,
codeguru-reviewer:TagResource,
iam:CreateServiceLinkedRole,
codecommit:TagResource,
codecommit:GitPull,
codecommit:TagResource,
events:PutRule,
events:PutTargets,
codestar-connections:ListBranches,
codestar-connections:ListRepositories,
codestar-connections:ListTagsForResource,
codestar-connections:PassConnection,
codestar-connections:TagResource,
codestar-connections:UseConnection,
s3:ListBucket
codeguru-reviewer:DescribeRepositoryAssociation,
codeguru-reviewer:ListTagsForResource
codeguru-reviewer:DescribeRepositoryAssociation,
codeguru-reviewer:DisassociateRepository,
codecommit:UntagResource,
events:DeleteRule,
events:RemoveTargets,
codestar-connections:UntagResource,
codestar-connections:ListTagsForResource
codeguru-reviewer:ListRepositoryAssociations