AWS Amazon SageMaker Notebook Instance Lifecycle Configuration
This page shows how to write Terraform and CloudFormation for Amazon SageMaker Notebook Instance Lifecycle Configuration and write them securely.
aws_sagemaker_notebook_instance_lifecycle_configuration (Terraform)
The Notebook Instance Lifecycle Configuration in Amazon SageMaker can be configured in Terraform with the resource name aws_sagemaker_notebook_instance_lifecycle_configuration
. The following sections describe 3 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_sagemaker_notebook_instance_lifecycle_configuration" "basic_lifecycle" {
name = "dev-platform-al-sm-frauddetection-lifecycle-config"
on_create = base64encode(data.template_file.on_create.rendered)
on_start = base64encode(data.template_file.on_start.rendered)
depends_on = [aws_s3_bucket.s3_bucket_model_training_data]
resource "aws_sagemaker_notebook_instance_lifecycle_configuration" "main" {
name = var.name
on_create = var.on_create
on_start = var.on_start
}
resource "aws_sagemaker_notebook_instance_lifecycle_configuration" "notebook_config" {
name = "dev-platform-al-sm-lifecycle-config"
on_create = filebase64("../scripts/on-create.sh")
on_start = filebase64("../scripts/on-start.sh")
Parameters
-
arn
optional computed - string -
id
optional computed - string -
name
optional - string -
on_create
optional - string -
on_start
optional - string
Explanation in Terraform Registry
Provides a lifecycle configuration for SageMaker Notebook Instances.
AWS::SageMaker::NotebookInstanceLifecycleConfig (CloudFormation)
The NotebookInstanceLifecycleConfig in SageMaker can be configured in CloudFormation with the resource name AWS::SageMaker::NotebookInstanceLifecycleConfig
. 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
-
OnStart
optional - List of NotebookInstanceLifecycleHook -
NotebookInstanceLifecycleConfigName
optional - String -
OnCreate
optional - List of NotebookInstanceLifecycleHook
Explanation in CloudFormation Registry
The
AWS::SageMaker::NotebookInstanceLifecycleConfig
resource creates shell scripts that run when you create and/or start a notebook instance. For information about notebook instance lifecycle configurations, see Customize a Notebook Instance in the Amazon SageMaker Developer Guide.
Frequently asked questions
What is AWS Amazon SageMaker Notebook Instance Lifecycle Configuration?
AWS Amazon SageMaker Notebook Instance Lifecycle Configuration 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 Lifecycle Configuration?
For Terraform, the AndreasLuckert/fraud-detection-using-terraform-and-sagemaker, boldlink/terraform and AndreasLuckert/aws-sm-notebook-instance source code examples are useful. See the Terraform Example section for further details.