notebook_instance_lifecycle_configs
Creates, updates, deletes, gets or lists a notebook_instance_lifecycle_configs resource.
Overview
| Name | notebook_instance_lifecycle_configs |
| Type | Resource |
| Id | aws.sagemaker.notebook_instance_lifecycle_configs |
Fields
The following fields are returned by SELECT queries:
- describe_notebook_instance_lifecycle_config
- list_notebook_instance_lifecycle_configs
| Name | Datatype | Description |
|---|---|---|
creation_time | string (date-time) | A timestamp that tells when the lifecycle configuration was created. |
last_modified_time | string (date-time) | A timestamp that tells when the lifecycle configuration was last modified. |
notebook_instance_lifecycle_config_arn | string | The Amazon Resource Name (ARN) of the lifecycle configuration. |
notebook_instance_lifecycle_config_name | string | The name of the lifecycle configuration. (pattern: <code>[a-zA-Z0-9](-[a-zA-Z0-9])</code>) |
on_create | array | The shell script that runs only once, when you create a notebook instance. |
on_start | array | The shell script that runs every time you start a notebook instance, including when you create the notebook instance. |
| Name | Datatype | Description |
|---|---|---|
creation_time | string (date-time) | A timestamp that tells when the lifecycle configuration was created. |
last_modified_time | string (date-time) | A timestamp that tells when the lifecycle configuration was last modified. |
notebook_instance_lifecycle_config_arn | string | The Amazon Resource Name (ARN) of the lifecycle configuration. |
notebook_instance_lifecycle_config_name | string | The name of the lifecycle configuration. (pattern: <code>[a-zA-Z0-9](-[a-zA-Z0-9])</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_notebook_instance_lifecycle_config | select | region | Returns a description of a notebook instance lifecycle configuration. For information about notebook instance lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance. | |
list_notebook_instance_lifecycle_configs | select | region | Lists notebook instance lifestyle configurations created with the CreateNotebookInstanceLifecycleConfig API. | |
create_notebook_instance_lifecycle_config | insert | region, NotebookInstanceLifecycleConfigName | Creates a lifecycle configuration that you can associate with a notebook instance. A lifecycle configuration is a collection of shell scripts that run when you create or start a notebook instance. Each lifecycle configuration script has a limit of 16384 characters. The value of the $PATH environment variable that is available to both scripts is /sbin:bin:/usr/sbin:/usr/bin. View Amazon CloudWatch Logs for notebook instance lifecycle configurations in log group /aws/sagemaker/NotebookInstances in log stream [notebook-instance-name]/[LifecycleConfigHook]. Lifecycle configuration scripts cannot run for longer than 5 minutes. If a script runs for longer than 5 minutes, it fails and the notebook instance is not created or started. For information about notebook instance lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance. Lifecycle configuration scripts execute with root access and the notebook instance's IAM execution role privileges. Grant this permission only to trusted principals. See Customize a Notebook Instance Using a Lifecycle Configuration Script for security best practices. | |
update_notebook_instance_lifecycle_config | update | region, NotebookInstanceLifecycleConfigName | Updates a notebook instance lifecycle configuration created with the CreateNotebookInstanceLifecycleConfig API. Updates to lifecycle configurations affect all notebook instances using that configuration upon their next start. Lifecycle configuration scripts execute with root access and the notebook instance's IAM execution role privileges. Grant this permission only to trusted principals. See Customize a Notebook Instance Using a Lifecycle Configuration Script for security best practices. | |
delete_notebook_instance_lifecycle_config | delete | region | Deletes a notebook instance lifecycle configuration. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_notebook_instance_lifecycle_config
- list_notebook_instance_lifecycle_configs
Returns a description of a notebook instance lifecycle configuration. For information about notebook instance lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.
SELECT
creation_time,
last_modified_time,
notebook_instance_lifecycle_config_arn,
notebook_instance_lifecycle_config_name,
on_create,
on_start
FROM aws.sagemaker.notebook_instance_lifecycle_configs
WHERE region = '{{ region }}' -- required
;
Lists notebook instance lifestyle configurations created with the CreateNotebookInstanceLifecycleConfig API.
SELECT
creation_time,
last_modified_time,
notebook_instance_lifecycle_config_arn,
notebook_instance_lifecycle_config_name
FROM aws.sagemaker.notebook_instance_lifecycle_configs
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_notebook_instance_lifecycle_config
- Manifest
Creates a lifecycle configuration that you can associate with a notebook instance. A lifecycle configuration is a collection of shell scripts that run when you create or start a notebook instance. Each lifecycle configuration script has a limit of 16384 characters. The value of the $PATH environment variable that is available to both scripts is /sbin:bin:/usr/sbin:/usr/bin. View Amazon CloudWatch Logs for notebook instance lifecycle configurations in log group /aws/sagemaker/NotebookInstances in log stream [notebook-instance-name]/[LifecycleConfigHook]. Lifecycle configuration scripts cannot run for longer than 5 minutes. If a script runs for longer than 5 minutes, it fails and the notebook instance is not created or started. For information about notebook instance lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance. Lifecycle configuration scripts execute with root access and the notebook instance's IAM execution role privileges. Grant this permission only to trusted principals. See Customize a Notebook Instance Using a Lifecycle Configuration Script for security best practices.
INSERT INTO aws.sagemaker.notebook_instance_lifecycle_configs (
NotebookInstanceLifecycleConfigName,
OnCreate,
OnStart,
Tags,
region
)
SELECT
'{{ NotebookInstanceLifecycleConfigName }}' /* required */,
'{{ OnCreate }}',
'{{ OnStart }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
notebook_instance_lifecycle_config_arn
;
# Description fields are for documentation purposes
- name: notebook_instance_lifecycle_configs
props:
- name: region
value: "{{ region }}"
description: Required parameter for the notebook_instance_lifecycle_configs resource.
- name: NotebookInstanceLifecycleConfigName
value: "{{ NotebookInstanceLifecycleConfigName }}"
description: |
The name of the lifecycle configuration.
- name: OnCreate
description: |
A shell script that runs only once, when you create a notebook instance. The shell script must be a base64-encoded string.
value:
- Content: "{{ Content }}"
- name: OnStart
description: |
A shell script that runs every time you start a notebook instance, including when you create the notebook instance. The shell script must be a base64-encoded string.
value:
- Content: "{{ Content }}"
- name: Tags
description: |
An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_notebook_instance_lifecycle_config
Updates a notebook instance lifecycle configuration created with the CreateNotebookInstanceLifecycleConfig API. Updates to lifecycle configurations affect all notebook instances using that configuration upon their next start. Lifecycle configuration scripts execute with root access and the notebook instance's IAM execution role privileges. Grant this permission only to trusted principals. See Customize a Notebook Instance Using a Lifecycle Configuration Script for security best practices.
UPDATE aws.sagemaker.notebook_instance_lifecycle_configs
SET
NotebookInstanceLifecycleConfigName = '{{ NotebookInstanceLifecycleConfigName }}',
OnCreate = '{{ OnCreate }}',
OnStart = '{{ OnStart }}'
WHERE
region = '{{ region }}' --required
AND NotebookInstanceLifecycleConfigName = '{{ NotebookInstanceLifecycleConfigName }}' --required;
DELETE examples
- delete_notebook_instance_lifecycle_config
Deletes a notebook instance lifecycle configuration.
DELETE FROM aws.sagemaker.notebook_instance_lifecycle_configs
WHERE region = '{{ region }}' --required
;