repository_associations
Creates, updates, deletes, gets or lists a repository_associations resource.
Overview
| Name | repository_associations |
| Type | Resource |
| Id | aws.codeguru_reviewer.repository_associations |
Fields
The following fields are returned by SELECT queries:
- describe_repository_association
- list_repository_associations
| Name | Datatype | Description |
|---|---|---|
repository_association | object | Information about the repository association. |
tags | object | An array of key-value pairs used to tag an associated repository. A tag is a custom attribute label with two parts: A tag key (for example, CostCenter, Environment, Project, or Secret). Tag keys are case sensitive. An optional field known as a tag value (for example, 111122223333, Production, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive. |
| Name | Datatype | Description |
|---|---|---|
association_arn | string | The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations. (pattern: <code>^arn:aws[^:\s]*:codeguru-reviewer:[^:\s]+:[\d]{12}:[a-z-]+:[\w-]+$</code>) |
association_id | string | The repository association ID. |
connection_arn | string | The Amazon Resource Name (ARN) of an Amazon Web Services CodeStar Connections connection. Its format is arn:aws:codestar-connections:region-id:aws-account_id:connection/connection-id. For more information, see Connection in the Amazon Web Services CodeStar Connections API Reference. (pattern: <code>arn:aws(-[\w]+)*:.+:.+:[0-9]{12}:.+</code>) |
last_updated_time_stamp | string (date-time) | The time, in milliseconds since the epoch, since the repository association was last updated. |
name | string | The name of the repository association. (pattern: <code>^\S[\w.-]*$</code>) |
owner | string | The owner of the repository. For an Amazon Web Services CodeCommit repository, this is the Amazon Web Services account ID of the account that owns the repository. For a GitHub, GitHub Enterprise Server, or Bitbucket repository, this is the username for the account that owns the repository. For an S3 repository, it can be the username or Amazon Web Services account ID. (pattern: <code>^\S(.*\S)?$</code>) |
provider_type | string | The provider type of the repository association. (CodeCommit, GitHub, Bitbucket, GitHubEnterpriseServer, S3Bucket) |
state | string | The state of the repository association. The valid repository association states are: Associated: The repository association is complete. Associating: CodeGuru Reviewer is: Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review. If your repository ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered. Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository. Failed: The repository failed to associate or disassociate. Disassociating: CodeGuru Reviewer is removing the repository's pull request notifications and source code access. Disassociated: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in anassociated repository with tags after it has been disassociated. For more information, see Using tags to control access to associated repositories in the Amazon CodeGuru Reviewer User Guide. (Associated, Associating, Failed, Disassociating, Disassociated) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_repository_association | select | association_arn, region | Returns a RepositoryAssociation object that contains information about the requested repository association. | |
list_repository_associations | select | region | ProviderType, State, Name, Owner, MaxResults, NextToken | Returns a list of RepositoryAssociationSummary objects that contain summary information about a repository association. You can filter the returned list by ProviderType, Name, State, and Owner. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
association_arn | string | The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations. |
region | string | AWS region (default: us-east-1) |
MaxResults | integer | The maximum number of repository association results returned by ListRepositoryAssociations in paginated output. When this parameter is used, ListRepositoryAssociations only returns maxResults results in a single page with a nextToken response element. The remaining results of the initial request can be seen by sending another ListRepositoryAssociations request with the returned nextToken value. This value can be between 1 and 100. If this parameter is not used, ListRepositoryAssociations returns up to 100 results and a nextToken value if applicable. |
Name | array | List of repository names to use as a filter. |
NextToken | string | The nextToken value returned from a previous paginated ListRepositoryAssociations request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. Treat this token as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes. |
Owner | array | List of owners to use as a filter. For Amazon Web Services CodeCommit, it is the name of the CodeCommit account that was used to associate the repository. For other repository source providers, such as Bitbucket and GitHub Enterprise Server, this is name of the account that was used to associate the repository. |
ProviderType | array | List of provider types to use as a filter. |
State | array | List of repository association states to use as a filter. The valid repository association states are: Associated: The repository association is complete. Associating: CodeGuru Reviewer is: Setting up pull request notifications. This is required for pull requests to trigger a CodeGuru Reviewer review. If your repository ProviderType is GitHub, GitHub Enterprise Server, or Bitbucket, CodeGuru Reviewer creates webhooks in your repository to trigger CodeGuru Reviewer reviews. If you delete these webhooks, reviews of code in your repository cannot be triggered. Setting up source code access. This is required for CodeGuru Reviewer to securely clone code in your repository. Failed: The repository failed to associate or disassociate. Disassociating: CodeGuru Reviewer is removing the repository's pull request notifications and source code access. Disassociated: CodeGuru Reviewer successfully disassociated the repository. You can create a new association with this repository if you want to review source code in it later. You can control access to code reviews created in anassociated repository with tags after it has been disassociated. For more information, see Using tags to control access to associated repositories in the Amazon CodeGuru Reviewer User Guide. |
SELECT examples
- describe_repository_association
- list_repository_associations
Returns a RepositoryAssociation object that contains information about the requested repository association.
SELECT
repository_association,
tags
FROM aws.codeguru_reviewer.repository_associations
WHERE association_arn = '{{ association_arn }}' -- required
AND region = '{{ region }}' -- required
;
Returns a list of RepositoryAssociationSummary objects that contain summary information about a repository association. You can filter the returned list by ProviderType, Name, State, and Owner.
SELECT
association_arn,
association_id,
connection_arn,
last_updated_time_stamp,
name,
owner,
provider_type,
state
FROM aws.codeguru_reviewer.repository_associations
WHERE region = '{{ region }}' -- required
AND ProviderType = '{{ ProviderType }}'
AND State = '{{ State }}'
AND Name = '{{ Name }}'
AND Owner = '{{ Owner }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;