Resource: aws_sagemaker_notebook_instance

Provides a SageMaker Notebook Instance resource.

Example Usage

Basic usage

resource "aws_sagemaker_notebook_instance" "ni" {
  name          = "my-notebook-instance"
  role_arn      = aws_iam_role.role.arn
  instance_type = "ml.t2.medium"

  tags = {
    Name = "foo"
  }
}

Code repository usage

resource "aws_sagemaker_code_repository" "example" {
  code_repository_name = "my-notebook-instance-code-repo"

  git_config {
    repository_url = "https://github.com/hashicorp/terraform-provider-aws.git"
  }
}

resource "aws_sagemaker_notebook_instance" "ni" {
  name                    = "my-notebook-instance"
  role_arn                = aws_iam_role.role.arn
  instance_type           = "ml.t2.medium"
  default_code_repository = aws_sagemaker_code_repository.example.code_repository_name

  tags = {
    Name = "foo"
  }
}

Argument Reference

This resource supports the following arguments:

instance_metadata_service_configuration

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import SageMaker Notebook Instances using the name. For example:

import {
  to = aws_sagemaker_notebook_instance.test_notebook_instance
  id = "my-notebook-instance"
}

Using terraform import, import SageMaker Notebook Instances using the name. For example:

% terraform import aws_sagemaker_notebook_instance.test_notebook_instance my-notebook-instance