AWS Amazon SageMaker Code Repository
This page shows how to write Terraform and CloudFormation for Amazon SageMaker Code Repository and write them securely.
aws_sagemaker_code_repository (Terraform)
The Code Repository in Amazon SageMaker can be configured in Terraform with the resource name aws_sagemaker_code_repository
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_sagemaker_code_repository" "prm_gp2gp_data_sandbox" {
code_repository_name = "prm-gp2gp-data-sandbox"
git_config {
repository_url = var.data_sandbox_url
}
resource "aws_sagemaker_code_repository" "sagemaker-model-repository" {
code_repository_name = "sagemaker-model-repository"
git_config {
repository_url = "https://github.com/ldynczuki/MLPlatformEngineer"
}
resource "aws_sagemaker_code_repository" "git_repo" {
code_repository_name = "aws-sm-notebook-instance-repo"
git_config {
repository_url = "https://github.com/AndreasLuckert/aws-sm-notebook-instance.git"
}
resource "aws_sagemaker_code_repository" "repo" {
count = var.default_code_repository != null ? 1 : 0
code_repository_name = var.default_code_repository
git_config {
repository_url = var.repository_url
resource "aws_sagemaker_code_repository" "git_repo" {
code_repository_name = "aws-sm-notebook-instance-repo"
git_config {
repository_url = "https://github.com/AndreasLuckert/fraud-detection-using-terraform-and-sagemaker.git"
}
Parameters
-
arn
optional computed - string -
code_repository_name
required - string -
id
optional computed - string -
git_config
list block-
branch
optional - string -
repository_url
required - string -
secret_arn
optional - string
-
Explanation in Terraform Registry
Provides a Sagemaker Code Repository resource.
AWS::SageMaker::CodeRepository (CloudFormation)
The CodeRepository in SageMaker can be configured in CloudFormation with the resource name AWS::SageMaker::CodeRepository
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
CodeRepositoryName
optional - String -
GitConfig
required - GitConfig -
Tags
optional - List of Tag
Explanation in CloudFormation Registry
Creates a Git repository as a resource in your Amazon SageMaker 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 Amazon SageMaker 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 AWS CodeCommit or in any other Git repository.
Frequently asked questions
What is AWS Amazon SageMaker Code Repository?
AWS Amazon SageMaker Code Repository is a resource for Amazon SageMaker of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS Amazon SageMaker Code Repository?
For Terraform, the nhsconnect/prm-gp2gp-data-sandbox-infra, ldynczuki/ml-platform-engineer and AndreasLuckert/aws-sm-notebook-instance source code examples are useful. See the Terraform Example section for further details.