repositories
Creates, updates, deletes, gets or lists a repositories resource.
Overview
| Name | repositories |
| Type | Resource |
| Id | aws.codecommit.repositories |
Fields
The following fields are returned by SELECT queries:
- batch_get_repositories
- get_repository
- list_repositories
| Name | Datatype | Description |
|---|---|---|
errors | array | Returns information about any errors returned when attempting to retrieve information about the repositories. |
repositories | array | A list of repositories returned by the batch get repositories operation. |
repositories_not_found | array | Returns a list of repository names for which information could not be found. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the repository. |
account_id | string | The ID of the Amazon Web Services account associated with the repository. |
clone_url_http | string | The URL to use for cloning the repository over HTTPS. |
clone_url_ssh | string | The URL to use for cloning the repository over SSH. |
creation_date | string (date-time) | The date and time the repository was created, in timestamp format. |
default_branch | string | The repository's default branch name. |
kms_key_id | string | The ID of the Key Management Service encryption key used to encrypt and decrypt the repository. (pattern: <code>^[a-zA-Z0-9:/_-]+$</code>) |
last_modified_date | string (date-time) | The date and time the repository was last modified, in timestamp format. |
repository_description | string | A comment or description about the repository. |
repository_id | string | The ID of the repository. |
repository_name | string | The repository's name. (pattern: <code>[\w.-]+</code>) |
| Name | Datatype | Description |
|---|---|---|
repository_id | string | The ID associated with the repository. |
repository_name | string | The name associated with the repository. (pattern: <code>[\w.-]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_get_repositories | select | region | Returns information about one or more repositories. The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage. | |
get_repository | select | region | Returns information about a repository. The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage. | |
list_repositories | select | region | Gets information about one or more repositories. | |
create_repository | insert | region, repositoryName | Creates a new, empty repository. | |
associate_approval_rule_template_with_repository | update | region, approvalRuleTemplateName, repositoryName | Creates an association between an approval rule template and a specified repository. Then, the next time a pull request is created in the repository where the destination reference (if specified) matches the destination reference (branch) for the pull request, an approval rule that matches the template conditions is automatically created for that pull request. If no destination references are specified in the template, an approval rule that matches the template contents is created for all pull requests in that repository. | |
update_repository_encryption_key | update | region, repositoryName, kmsKeyId | Updates the Key Management Service encryption key used to encrypt and decrypt a CodeCommit repository. | |
update_repository_name | update | region, oldName, newName | Renames a repository. The repository name must be unique across the calling Amazon Web Services account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. The suffix .git is prohibited. For more information about the limits on repository names, see Quotas in the CodeCommit User Guide. | |
update_repository_description | update | region, repositoryName | Sets or changes the comment or description for a repository. The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage. | |
delete_repository | delete | region | Deletes a repository. If a specified repository was already deleted, a null repository ID is returned. Deleting a repository also deletes all associated objects and metadata. After a repository is deleted, all future push calls to the deleted repository fail. | |
batch_associate_approval_rule_template_with_repositories | exec | region, approvalRuleTemplateName, repositoryNames | Creates an association between an approval rule template and one or more specified repositories. | |
batch_disassociate_approval_rule_template_from_repositories | exec | region, approvalRuleTemplateName, repositoryNames | Removes the association between an approval rule template and one or more specified repositories. | |
disassociate_approval_rule_template_from_repository | exec | region, approvalRuleTemplateName, repositoryName | Removes the association between a template and a repository so that approval rules based on the template are not automatically created when pull requests are created in the specified repository. This does not delete any approval rules previously created for pull requests through the template association. | |
merge_branches_by_fast_forward | exec | region, repositoryName, sourceCommitSpecifier, destinationCommitSpecifier | Merges two branches using the fast-forward merge strategy. | |
merge_branches_by_squash | exec | region, repositoryName, sourceCommitSpecifier, destinationCommitSpecifier | Merges two branches using the squash merge strategy. | |
merge_branches_by_three_way | exec | region, repositoryName, sourceCommitSpecifier, destinationCommitSpecifier | Merges two specified branches using the three-way merge strategy. | |
post_comment_for_compared_commit | exec | region, repositoryName, afterCommitId, content | Posts a comment on the comparison between two commits. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- batch_get_repositories
- get_repository
- list_repositories
Returns information about one or more repositories. The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.
SELECT
errors,
repositories,
repositories_not_found
FROM aws.codecommit.repositories
WHERE region = '{{ region }}' -- required
;
Returns information about a repository. The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.
SELECT
arn,
account_id,
clone_url_http,
clone_url_ssh,
creation_date,
default_branch,
kms_key_id,
last_modified_date,
repository_description,
repository_id,
repository_name
FROM aws.codecommit.repositories
WHERE region = '{{ region }}' -- required
;
Gets information about one or more repositories.
SELECT
repository_id,
repository_name
FROM aws.codecommit.repositories
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_repository
- Manifest
Creates a new, empty repository.
INSERT INTO aws.codecommit.repositories (
repositoryName,
repositoryDescription,
tags,
kmsKeyId,
region
)
SELECT
'{{ repositoryName }}' /* required */,
'{{ repositoryDescription }}',
'{{ tags }}',
'{{ kmsKeyId }}',
'{{ region }}'
RETURNING
repository_metadata
;
# Description fields are for documentation purposes
- name: repositories
props:
- name: region
value: "{{ region }}"
description: Required parameter for the repositories resource.
- name: repositoryName
value: "{{ repositoryName }}"
description: |
The name of the new repository to be created. The repository name must be unique across the calling Amazon Web Services account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For more information about the limits on repository names, see Quotas in the CodeCommit User Guide. The suffix .git is prohibited.
- name: repositoryDescription
value: "{{ repositoryDescription }}"
description: |
A comment or description about the new repository. The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.
- name: tags
value: "{{ tags }}"
description: |
One or more tag key-value pairs to use when tagging this repository.
- name: kmsKeyId
value: "{{ kmsKeyId }}"
description: |
The ID of the encryption key. You can view the ID of an encryption key in the KMS console, or use the KMS APIs to programmatically retrieve a key ID. For more information about acceptable values for kmsKeyID, see KeyId in the Decrypt API description in the Key Management Service API Reference. If no key is specified, the default aws/codecommit Amazon Web Services managed key is used.
UPDATE examples
- associate_approval_rule_template_with_repository
- update_repository_encryption_key
- update_repository_name
- update_repository_description
Creates an association between an approval rule template and a specified repository. Then, the next time a pull request is created in the repository where the destination reference (if specified) matches the destination reference (branch) for the pull request, an approval rule that matches the template conditions is automatically created for that pull request. If no destination references are specified in the template, an approval rule that matches the template contents is created for all pull requests in that repository.
UPDATE aws.codecommit.repositories
SET
approvalRuleTemplateName = '{{ approvalRuleTemplateName }}',
repositoryName = '{{ repositoryName }}'
WHERE
region = '{{ region }}' --required
AND approvalRuleTemplateName = '{{ approvalRuleTemplateName }}' --required
AND repositoryName = '{{ repositoryName }}' --required;
Updates the Key Management Service encryption key used to encrypt and decrypt a CodeCommit repository.
UPDATE aws.codecommit.repositories
SET
repositoryName = '{{ repositoryName }}',
kmsKeyId = '{{ kmsKeyId }}'
WHERE
region = '{{ region }}' --required
AND repositoryName = '{{ repositoryName }}' --required
AND kmsKeyId = '{{ kmsKeyId }}' --required
RETURNING
kms_key_id,
original_kms_key_id,
repository_id;
Renames a repository. The repository name must be unique across the calling Amazon Web Services account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. The suffix .git is prohibited. For more information about the limits on repository names, see Quotas in the CodeCommit User Guide.
UPDATE aws.codecommit.repositories
SET
oldName = '{{ oldName }}',
newName = '{{ newName }}'
WHERE
region = '{{ region }}' --required
AND oldName = '{{ oldName }}' --required
AND newName = '{{ newName }}' --required;
Sets or changes the comment or description for a repository. The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.
UPDATE aws.codecommit.repositories
SET
repositoryName = '{{ repositoryName }}',
repositoryDescription = '{{ repositoryDescription }}'
WHERE
region = '{{ region }}' --required
AND repositoryName = '{{ repositoryName }}' --required;
DELETE examples
- delete_repository
Deletes a repository. If a specified repository was already deleted, a null repository ID is returned. Deleting a repository also deletes all associated objects and metadata. After a repository is deleted, all future push calls to the deleted repository fail.
DELETE FROM aws.codecommit.repositories
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- batch_associate_approval_rule_template_with_repositories
- batch_disassociate_approval_rule_template_from_repositories
- disassociate_approval_rule_template_from_repository
- merge_branches_by_fast_forward
- merge_branches_by_squash
- merge_branches_by_three_way
- post_comment_for_compared_commit
Creates an association between an approval rule template and one or more specified repositories.
EXEC aws.codecommit.repositories.batch_associate_approval_rule_template_with_repositories
@region='{{ region }}' --required
@@json=
'{
"approvalRuleTemplateName": "{{ approvalRuleTemplateName }}",
"repositoryNames": "{{ repositoryNames }}"
}'
;
Removes the association between an approval rule template and one or more specified repositories.
EXEC aws.codecommit.repositories.batch_disassociate_approval_rule_template_from_repositories
@region='{{ region }}' --required
@@json=
'{
"approvalRuleTemplateName": "{{ approvalRuleTemplateName }}",
"repositoryNames": "{{ repositoryNames }}"
}'
;
Removes the association between a template and a repository so that approval rules based on the template are not automatically created when pull requests are created in the specified repository. This does not delete any approval rules previously created for pull requests through the template association.
EXEC aws.codecommit.repositories.disassociate_approval_rule_template_from_repository
@region='{{ region }}' --required
@@json=
'{
"approvalRuleTemplateName": "{{ approvalRuleTemplateName }}",
"repositoryName": "{{ repositoryName }}"
}'
;
Merges two branches using the fast-forward merge strategy.
EXEC aws.codecommit.repositories.merge_branches_by_fast_forward
@region='{{ region }}' --required
@@json=
'{
"repositoryName": "{{ repositoryName }}",
"sourceCommitSpecifier": "{{ sourceCommitSpecifier }}",
"destinationCommitSpecifier": "{{ destinationCommitSpecifier }}",
"targetBranch": "{{ targetBranch }}"
}'
;
Merges two branches using the squash merge strategy.
EXEC aws.codecommit.repositories.merge_branches_by_squash
@region='{{ region }}' --required
@@json=
'{
"repositoryName": "{{ repositoryName }}",
"sourceCommitSpecifier": "{{ sourceCommitSpecifier }}",
"destinationCommitSpecifier": "{{ destinationCommitSpecifier }}",
"targetBranch": "{{ targetBranch }}",
"conflictDetailLevel": "{{ conflictDetailLevel }}",
"conflictResolutionStrategy": "{{ conflictResolutionStrategy }}",
"authorName": "{{ authorName }}",
"email": "{{ email }}",
"commitMessage": "{{ commitMessage }}",
"keepEmptyFolders": {{ keepEmptyFolders }},
"conflictResolution": "{{ conflictResolution }}"
}'
;
Merges two specified branches using the three-way merge strategy.
EXEC aws.codecommit.repositories.merge_branches_by_three_way
@region='{{ region }}' --required
@@json=
'{
"repositoryName": "{{ repositoryName }}",
"sourceCommitSpecifier": "{{ sourceCommitSpecifier }}",
"destinationCommitSpecifier": "{{ destinationCommitSpecifier }}",
"targetBranch": "{{ targetBranch }}",
"conflictDetailLevel": "{{ conflictDetailLevel }}",
"conflictResolutionStrategy": "{{ conflictResolutionStrategy }}",
"authorName": "{{ authorName }}",
"email": "{{ email }}",
"commitMessage": "{{ commitMessage }}",
"keepEmptyFolders": {{ keepEmptyFolders }},
"conflictResolution": "{{ conflictResolution }}"
}'
;
Posts a comment on the comparison between two commits.
EXEC aws.codecommit.repositories.post_comment_for_compared_commit
@region='{{ region }}' --required
@@json=
'{
"repositoryName": "{{ repositoryName }}",
"beforeCommitId": "{{ beforeCommitId }}",
"afterCommitId": "{{ afterCommitId }}",
"location": "{{ location }}",
"content": "{{ content }}",
"clientRequestToken": "{{ clientRequestToken }}"
}'
;