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_repositoriesoptional - set of string -
arnoptional computed - string -
default_code_repositoryoptional - string -
direct_internet_accessoptional - string -
idoptional computed - string -
instance_typerequired - string -
kms_key_idoptional - string -
lifecycle_config_nameoptional - string -
namerequired - string -
network_interface_idoptional computed - string -
role_arnrequired - string -
root_accessoptional - string -
security_groupsoptional computed - set of string -
subnet_idoptional - string -
tagsoptional - map from string to string -
urloptional computed - string -
volume_sizeoptional - 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
-
KmsKeyIdoptional - String -
VolumeSizeInGBoptional - Integer -
AdditionalCodeRepositoriesoptional - List -
DefaultCodeRepositoryoptional - String -
DirectInternetAccessoptional - String -
PlatformIdentifieroptional - String -
AcceleratorTypesoptional - List -
SubnetIdoptional - String -
SecurityGroupIdsoptional - List -
RoleArnrequired - String -
RootAccessoptional - String -
NotebookInstanceNameoptional - String -
InstanceTyperequired - String -
LifecycleConfigNameoptional - String -
Tagsoptional - List of Tag
Explanation in CloudFormation Registry
The
AWS::SageMaker::NotebookInstanceresource 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.