Skip to content
GitHubXDiscordRSS

CodeRepository

Learn how to create, update, and manage AWS SageMaker CodeRepositorys using Alchemy Cloud Control.

The CodeRepository resource allows you to manage AWS SageMaker CodeRepositorys for version control of your machine learning code.

Create a basic CodeRepository with essential properties:

import AWS from "alchemy/aws/control";
const simpleCodeRepository = await AWS.SageMaker.CodeRepository("simpleCodeRepo", {
CodeRepositoryName: "MyCodeRepo",
GitConfig: {
RepositoryUrl: "https://github.com/my-user/my-repo.git",
Branch: "main",
SecretArn: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MySecret"
},
Tags: [
{ Key: "Environment", Value: "Development" }
]
});

Configure a CodeRepository with additional tags and settings:

const advancedCodeRepository = await AWS.SageMaker.CodeRepository("advancedCodeRepo", {
CodeRepositoryName: "AdvancedRepo",
GitConfig: {
RepositoryUrl: "https://github.com/my-user/advanced-repo.git",
Branch: "dev",
SecretArn: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyAdvancedSecret"
},
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Project", Value: "MLResearch" }
],
adopt: true
});

Create a CodeRepository that integrates with version control systems effectively:

const versionControlledRepo = await AWS.SageMaker.CodeRepository("versionedRepo", {
CodeRepositoryName: "VersionControlledRepo",
GitConfig: {
RepositoryUrl: "https://github.com/my-user/versioned-repo.git",
Branch: "release",
SecretArn: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyVersionedSecret"
},
Tags: [
{ Key: "Purpose", Value: "Training" }
]
});

Adopt an existing CodeRepository instead of failing if it already exists:

const adoptExistingRepo = await AWS.SageMaker.CodeRepository("existingRepo", {
CodeRepositoryName: "ExistingRepo",
GitConfig: {
RepositoryUrl: "https://github.com/my-user/existing-repo.git",
Branch: "stable",
SecretArn: "arn:aws:secretsmanager:us-west-2:123456789012:secret:MyExistingSecret"
},
adopt: true
});