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 | aws.codegurureviewer.repository_associations |
Fields
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. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Name, Type, region |
delete_resource | DELETE | data__Identifier, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.codegurureviewer.repository_associations (
Name,
Type,
region
)
SELECT
'{{ Name }}',
'{{ Type }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.codegurureviewer.repository_associations (
Name,
Type,
Owner,
BucketName,
ConnectionArn,
Tags,
region
)
SELECT
'{{ Name }}',
'{{ Type }}',
'{{ Owner }}',
'{{ BucketName }}',
'{{ ConnectionArn }}',
'{{ Tags }}',
'{{ region }}';
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: BucketName
value: '{{ BucketName }}'
- name: ConnectionArn
value: '{{ ConnectionArn }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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