Datalab Lifecycle Configurations
Datalab lifecycle configurations define startup and creation scripts that automate environment setup for notebooks and jobs.
Below is the sample resource definition file for Datalab Lifecycle Configuration:
{
"rDatalabLifecycleConfiguration": {
"Type": "DatalabLifecycleConfiguration",
"Properties": {
"LifecycleName": "cicdjoblcc",
"Description": "Base job lifecycle configuration for CICD QA testing",
"OnStartScript": {
"!Base64": "echo 'hello'"
},
"OnCreateScript": "",
"Keywords": [
"Owner: cicd"
]
}
}
}
DatalabLifecycleConfiguration has dependencies on Tag.
Dependent resources should not be deleted before the primary resource; attempting to do so may lead to failures or inconsistencies during the deletion process.
Referencing this Resource
Below are the common keys that can be used in the DependsOn function to retrieve details of this resource.
Supported Key
| Key | Description |
|---|---|
| LifecycleName | Returns the LifecycleName value of this resource |
For additional supported keys, refer to the API definition document for the respective resource type.
Example
The following example shows how to retrieve the lifecycle configuration name from a lifecycle configuration template and use it in a datalab template:
{
"rDatalab": {
"Type": "Datalab",
"Properties": {
"LifecycleConfig": {
"!DependsOn": "rDatalabLifecycleConfiguration.LifecycleName"
}
}
}
}
You can also reference the jobs lifecycle configuration using rDatalabLifecycleConfigurationJobs.LifecycleName.