aws_sdk_sagemaker/types/_notebook_instance_lifecycle_hook.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the notebook instance lifecycle configuration script.</p>
4/// <p>Each lifecycle configuration script has a limit of 16384 characters.</p>
5/// <p>The value of the <code>$PATH</code> environment variable that is available to both scripts is <code>/sbin:bin:/usr/sbin:/usr/bin</code>.</p>
6/// <p>View Amazon CloudWatch Logs for notebook instance lifecycle configurations in log group <code>/aws/sagemaker/NotebookInstances</code> in log stream <code>\[notebook-instance-name\]/\[LifecycleConfigHook\]</code>.</p>
7/// <p>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.</p>
8/// <p>For information about notebook instance lifestyle configurations, see <a href="https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html">Step 2.1: (Optional) Customize a Notebook Instance</a>.</p>
9#[non_exhaustive]
10#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
11pub struct NotebookInstanceLifecycleHook {
12 /// <p>A base64-encoded string that contains a shell script for a notebook instance lifecycle configuration.</p>
13 pub content: ::std::option::Option<::std::string::String>,
14}
15impl NotebookInstanceLifecycleHook {
16 /// <p>A base64-encoded string that contains a shell script for a notebook instance lifecycle configuration.</p>
17 pub fn content(&self) -> ::std::option::Option<&str> {
18 self.content.as_deref()
19 }
20}
21impl NotebookInstanceLifecycleHook {
22 /// Creates a new builder-style object to manufacture [`NotebookInstanceLifecycleHook`](crate::types::NotebookInstanceLifecycleHook).
23 pub fn builder() -> crate::types::builders::NotebookInstanceLifecycleHookBuilder {
24 crate::types::builders::NotebookInstanceLifecycleHookBuilder::default()
25 }
26}
27
28/// A builder for [`NotebookInstanceLifecycleHook`](crate::types::NotebookInstanceLifecycleHook).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct NotebookInstanceLifecycleHookBuilder {
32 pub(crate) content: ::std::option::Option<::std::string::String>,
33}
34impl NotebookInstanceLifecycleHookBuilder {
35 /// <p>A base64-encoded string that contains a shell script for a notebook instance lifecycle configuration.</p>
36 pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
37 self.content = ::std::option::Option::Some(input.into());
38 self
39 }
40 /// <p>A base64-encoded string that contains a shell script for a notebook instance lifecycle configuration.</p>
41 pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
42 self.content = input;
43 self
44 }
45 /// <p>A base64-encoded string that contains a shell script for a notebook instance lifecycle configuration.</p>
46 pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
47 &self.content
48 }
49 /// Consumes the builder and constructs a [`NotebookInstanceLifecycleHook`](crate::types::NotebookInstanceLifecycleHook).
50 pub fn build(self) -> crate::types::NotebookInstanceLifecycleHook {
51 crate::types::NotebookInstanceLifecycleHook { content: self.content }
52 }
53}