AWS Amazon SageMaker Notebook Instance

This page shows how to write Terraform and CloudFormation for Amazon SageMaker Notebook Instance and write them securely.

aws_sagemaker_notebook_instance (Terraform)

The Notebook Instance in Amazon SageMaker can be configured in Terraform with the resource name aws_sagemaker_notebook_instance. The following sections describe 5 examples of how to use the resource and its parameters.

Example Usage from GitHub

sagemaker_notebook_encryption.tf#L8
resource "aws_sagemaker_notebook_instance" "invalid" {
  name          = "my-notebook-instance"
  role_arn      = "arn"
  instance_type = "ml.t2.medium"

  tags = {
kms_key.tf#L22
resource "aws_sagemaker_notebook_instance" "kms_key_id_is_set" {
  name          = "foo"
  role_arn      = aws_iam_role.test_role.arn
  instance_type = "ml.t2.medium"
  kms_key_id    = aws_kms_key.test_key.id
}
kms_key.tf#L22
resource "aws_sagemaker_notebook_instance" "kms_key_id_is_set" {
  name          = "foo"
  role_arn      = aws_iam_role.test_role.arn
  instance_type = "ml.t2.medium"
  kms_key_id    = aws_kms_key.test_key.id
}
test.tf#L1
resource "aws_sagemaker_notebook_instance" "notebook1" {  # Noncompliant {{Make sure that using unencrypted SageMaker notebook instances is safe here.}}
#        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}

resource "aws_sagemaker_notebook_instance" "notebook2" { # Compliant
  kms_key_id = aws_kms_key.enc_key.key_id
sagemaker_notebook_internet_access.tf#L10
resource "aws_sagemaker_notebook_instance" "valid" {
  name          = "my-notebook-instance"
  role_arn      = aws_iam_role.test_role.arn
  instance_type = "ml.t2.medium"
  direct_internet_access = "Disabled"

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a Sagemaker Notebook Instance resource.

AWS::SageMaker::NotebookInstance (CloudFormation)

The NotebookInstance in SageMaker can be configured in CloudFormation with the resource name AWS::SageMaker::NotebookInstance. 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

Explanation in CloudFormation Registry

The AWS::SageMaker::NotebookInstance resource creates an Amazon SageMaker notebook instance. A notebook instance is a machine learning (ML) compute instance running on a Jupyter notebook. For more information, see Use Notebook Instances.

Frequently asked questions

What is AWS Amazon SageMaker Notebook Instance?

AWS Amazon SageMaker Notebook Instance 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 Notebook Instance?

For Terraform, the Cigna/confectionery, ffsclyh/config-lint and stelligent/config-lint source code examples are useful. See the Terraform Example section for further details.