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.
Idawscc.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.

For more information, see AWS::CodeGuruReviewer::RepositoryAssociation.

Methods

NameResourceAccessible byRequired Params
create_resourcerepository_associationsINSERTName, Type, region
delete_resourcerepository_associationsDELETEIdentifier, region
list_resourcesrepository_associations_list_onlySELECTregion
get_resourcerepository_associationsSELECTIdentifier, region

SELECT examples

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 }}';

INSERT example

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

/*+ 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
;

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:

ParameterDescription
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:

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