Lifecycle configuration update for Amazon SageMaker notebook instances

Amazon SageMaker now allows customers to update or disassociate lifecycle configurations for notebook instances with the renewed APIs. You can associate, switch between, or disable lifecycle configurations as necessary by stopping your notebook instance and using the UpdateNotebookInstance API at any point of the notebook instance’s lifespan.

Lifecycle configurations are handy when you want to organize and automate the setup that is necessary to build your data science workspace on notebook instances. They can execute a list of tasks every time a notebook instance starts. You can use a lifecycle configuration to install packages or sample notebooks on your notebook instance, preload data, configure networking and security, or use a shell script to customize it. After you create a lifecycle configuration, you can use it with multiple instances or save it for future use.

Previously, using a lifecycle configuration was only possible if you assigned one to a notebook instance when you were first creating it. Also, the only way to disable a lifecycle configuration was to delete the notebook instance. It’s now possible to use the UpdateNotebookInstance API to update or disassociate these lifecycle configurations for notebook instances.

Here’s how to update the lifecycle configuration on the AWS console:

First, we need to stop the running instance to update the settings. After it’s stopped, you’ll see that Update setting is enabled.

Click Update settingand use the menu to go to the Lifecycle configuration to detach the existing configuration or replace it with a different one:

Here is an example to demonstrate API request parameters:

1
2
3
4
5
6
7
8
{
 "DisassociateLifecycleConfig": boolean,
 "InstanceType": "string",
 "LifecycleConfigName": "string",
 "NotebookInstanceName": "string",
 "RoleArn": "string"
}

For more detailed explanations for the parameters, you can visit the Amazon SageMaker API documentation page here: https://docs.aws.amazon.com/sagemaker/latest/dg/API_UpdateNotebookInstance.html.

 


About the Author

Erkan Tas is a Senior Product Manager for Amazon SageMaker. He is on a mission to make Artificial Intelligence easy, accessible, and scalable through AWS platforms. He is also a sailor, science and nature admirer, Go and Stratocaster player.