Skip to main content

repository_associations

Creates, updates, deletes or gets a repository_association resource or lists repository_associations in a region

Overview

Namerepository_associations
TypeResource
DescriptionThis resource schema represents the RepositoryAssociation resource in the Amazon CodeGuru Reviewer service.
Idaws.codegurureviewer.repository_associations

Fields

NameDatatypeDescription
namestringName of the repository to be associated.
typestringThe type of repository to be associated.
ownerstringThe owner of the repository. For a Bitbucket repository, this is the username for the account that owns the repository.
bucket_namestringThe name of the S3 bucket associated with an associated S3 repository. It must start with `codeguru-reviewer-`.
connection_arnstringThe Amazon Resource Name (ARN) of an AWS CodeStar Connections connection.
association_arnstringThe Amazon Resource Name (ARN) of the repository association.
tagsarrayThe tags associated with a repository association.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTName, Type, region
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all repository_associations in a region.

SELECT
region,
name,
type,
owner,
bucket_name,
connection_arn,
association_arn,
tags
FROM aws.codegurureviewer.repository_associations
WHERE region = 'us-east-1';

Gets all properties from an individual repository_association.

SELECT
region,
name,
type,
owner,
bucket_name,
connection_arn,
association_arn,
tags
FROM aws.codegurureviewer.repository_associations
WHERE region = 'us-east-1' AND data__Identifier = '<AssociationArn>';

INSERT example

Use the following StackQL query and manifest file to create a new repository_association resource, using stack-deploy.

/*+ create */
INSERT INTO aws.codegurureviewer.repository_associations (
Name,
Type,
region
)
SELECT
'{{ Name }}',
'{{ Type }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.codegurureviewer.repository_associations
WHERE data__Identifier = '<AssociationArn>'
AND region = 'us-east-1';

Permissions

To operate on the repository_associations resource, the following permissions are required:

Create

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

Read

codeguru-reviewer:DescribeRepositoryAssociation,
codeguru-reviewer:ListTagsForResource

Delete

codeguru-reviewer:DescribeRepositoryAssociation,
codeguru-reviewer:DisassociateRepository,
codecommit:UntagResource,
events:DeleteRule,
events:RemoveTargets,
codestar-connections:UntagResource,
codestar-connections:ListTagsForResource

List

codeguru-reviewer:ListRepositoryAssociations