AWS Amazon SageMaker Notebook Instance

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

code-icon

Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.

get-started-button

Terraform Example (aws_sagemaker_notebook_instance)

Provides a Sagemaker Notebook Instance resource.

Parameters

Example Usage (from GitHub)

github-iconCigna/confectionery
resource "aws_sagemaker_notebook_instance" "invalid" {
  name          = "my-notebook-instance"
  role_arn      = "arn"
  instance_type = "ml.t2.medium"

  tags = {
github-iconffsclyh/config-lint
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
}
github-iconstelligent/config-lint
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
}
github-iconSonarSource/sonar-iac
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
github-iconCigna/confectionery
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"

CloudFormation Example (AWS::SageMaker::NotebookInstance)

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.

Parameters

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.