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
resource "aws_sagemaker_notebook_instance" "invalid" {
name = "my-notebook-instance"
role_arn = "arn"
instance_type = "ml.t2.medium"
tags = {
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
}
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
}
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
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"
Parameters
-
additional_code_repositories
optional - set of string -
arn
optional computed - string -
default_code_repository
optional - string -
direct_internet_access
optional - string -
id
optional computed - string -
instance_type
required - string -
kms_key_id
optional - string -
lifecycle_config_name
optional - string -
name
required - string -
network_interface_id
optional computed - string -
role_arn
required - string -
root_access
optional - string -
security_groups
optional computed - set of string -
subnet_id
optional - string -
tags
optional - map from string to string -
url
optional computed - string -
volume_size
optional - number
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
-
KmsKeyId
optional - String -
VolumeSizeInGB
optional - Integer -
AdditionalCodeRepositories
optional - List -
DefaultCodeRepository
optional - String -
DirectInternetAccess
optional - String -
PlatformIdentifier
optional - String -
AcceleratorTypes
optional - List -
SubnetId
optional - String -
SecurityGroupIds
optional - List -
RoleArn
required - String -
RootAccess
optional - String -
NotebookInstanceName
optional - String -
InstanceType
required - String -
LifecycleConfigName
optional - String -
Tags
optional - List of Tag
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.