code_repositories
Creates, updates, deletes, gets or lists a code_repositories resource.
Overview
| Name | code_repositories |
| Type | Resource |
| Id | aws.sagemaker.code_repositories |
Fields
The following fields are returned by SELECT queries:
- describe_code_repository
- list_code_repositories
| Name | Datatype | Description |
|---|---|---|
code_repository_arn | string | The Amazon Resource Name (ARN) of the Git repository. (pattern: <code>arn:aws[a-z-]*:sagemaker:[a-z0-9-]{9,16}:[0-9]{12}:code-repository/[\S]{1,2048}</code>) |
code_repository_name | string | The name of the Git repository. (pattern: <code>[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}</code>) |
creation_time | string (date-time) | The date and time that the repository was created. |
git_config | object | Configuration details about the repository, including the URL where the repository is located, the default branch, and the Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret that contains the credentials used to access the repository. |
last_modified_time | string (date-time) | The date and time that the repository was last changed. |
| Name | Datatype | Description |
|---|---|---|
code_repository_arn | string | The Amazon Resource Name (ARN) of the Git repository. (pattern: <code>arn:aws[a-z-]*:sagemaker:[a-z0-9-]{9,16}:[0-9]{12}:code-repository/[\S]{1,2048}</code>) |
code_repository_name | string | The name of the Git repository. (pattern: <code>[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}</code>) |
creation_time | string (date-time) | The date and time that the Git repository was created. |
git_config | object | Configuration details for the Git repository, including the URL where it is located and the ARN of the Amazon Web Services Secrets Manager secret that contains the credentials used to access the repository. |
last_modified_time | string (date-time) | The date and time that the Git repository was last modified. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_code_repository | select | region | Gets details about the specified Git repository. | |
list_code_repositories | select | region | Gets a list of the Git repositories in your account. | |
create_code_repository | insert | region, CodeRepositoryName, GitConfig | Creates a Git repository as a resource in your SageMaker AI account. You can associate the repository with notebook instances so that you can use Git source control for the notebooks you create. The Git repository is a resource in your SageMaker AI account, so it can be associated with more than one notebook instance, and it persists independently from the lifecycle of any notebook instances it is associated with. The repository can be hosted either in Amazon Web Services CodeCommit or in any other Git repository. | |
update_code_repository | update | region, CodeRepositoryName | Updates the specified Git repository with the specified values. | |
delete_code_repository | delete | region | Deletes the specified Git repository from your account. |
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
- describe_code_repository
- list_code_repositories
Gets details about the specified Git repository.
SELECT
code_repository_arn,
code_repository_name,
creation_time,
git_config,
last_modified_time
FROM aws.sagemaker.code_repositories
WHERE region = '{{ region }}' -- required
;
Gets a list of the Git repositories in your account.
SELECT
code_repository_arn,
code_repository_name,
creation_time,
git_config,
last_modified_time
FROM aws.sagemaker.code_repositories
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_code_repository
- Manifest
Creates a Git repository as a resource in your SageMaker AI account. You can associate the repository with notebook instances so that you can use Git source control for the notebooks you create. The Git repository is a resource in your SageMaker AI account, so it can be associated with more than one notebook instance, and it persists independently from the lifecycle of any notebook instances it is associated with. The repository can be hosted either in Amazon Web Services CodeCommit or in any other Git repository.
INSERT INTO aws.sagemaker.code_repositories (
CodeRepositoryName,
GitConfig,
Tags,
region
)
SELECT
'{{ CodeRepositoryName }}' /* required */,
'{{ GitConfig }}' /* required */,
'{{ Tags }}',
'{{ region }}'
RETURNING
code_repository_arn
;
# Description fields are for documentation purposes
- name: code_repositories
props:
- name: region
value: "{{ region }}"
description: Required parameter for the code_repositories resource.
- name: CodeRepositoryName
value: "{{ CodeRepositoryName }}"
description: |
The name of the Git repository. The name must have 1 to 63 characters. Valid characters are a-z, A-Z, 0-9, and - (hyphen).
- name: GitConfig
description: |
Specifies details about the repository, including the URL where the repository is located, the default branch, and credentials to use to access the repository.
value:
RepositoryUrl: "{{ RepositoryUrl }}"
Branch: "{{ Branch }}"
SecretArn: "{{ SecretArn }}"
- name: Tags
description: |
An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_code_repository
Updates the specified Git repository with the specified values.
UPDATE aws.sagemaker.code_repositories
SET
CodeRepositoryName = '{{ CodeRepositoryName }}',
GitConfig = '{{ GitConfig }}'
WHERE
region = '{{ region }}' --required
AND CodeRepositoryName = '{{ CodeRepositoryName }}' --required
RETURNING
code_repository_arn;
DELETE examples
- delete_code_repository
Deletes the specified Git repository from your account.
DELETE FROM aws.sagemaker.code_repositories
WHERE region = '{{ region }}' --required
;