Skip to main content

code_repositories

Creates, updates, deletes, gets or lists a code_repositories resource.

Overview

Namecode_repositories
TypeResource
Idaws.sagemaker.code_repositories

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
code_repository_arnstringThe 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_namestringThe name of the Git repository. (pattern: <code>[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}</code>)
creation_timestring (date-time)The date and time that the repository was created.
git_configobjectConfiguration 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_timestring (date-time)The date and time that the repository was last changed.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_code_repositoryselectregionGets details about the specified Git repository.
list_code_repositoriesselectregionGets a list of the Git repositories in your account.
create_code_repositoryinsertregion, CodeRepositoryName, GitConfigCreates 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_repositoryupdateregion, CodeRepositoryNameUpdates the specified Git repository with the specified values.
delete_code_repositorydeleteregionDeletes 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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
;

INSERT examples

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
;

UPDATE examples

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

Deletes the specified Git repository from your account.

DELETE FROM aws.sagemaker.code_repositories
WHERE region = '{{ region }}' --required
;