aws.sagemaker.NotebookInstanceLifecycleConfiguration
Explore with Pulumi AI
Provides a lifecycle configuration for SageMaker Notebook Instances.
Example Usage
Usage:
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as std from "@pulumi/std";
const lc = new aws.sagemaker.NotebookInstanceLifecycleConfiguration("lc", {
name: "foo",
onCreate: std.base64encode({
input: "echo foo",
}).then(invoke => invoke.result),
onStart: std.base64encode({
input: "echo bar",
}).then(invoke => invoke.result),
});
import pulumi
import pulumi_aws as aws
import pulumi_std as std
lc = aws.sagemaker.NotebookInstanceLifecycleConfiguration("lc",
name="foo",
on_create=std.base64encode(input="echo foo").result,
on_start=std.base64encode(input="echo bar").result)
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/sagemaker"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
invokeBase64encode, err := std.Base64encode(ctx, &std.Base64encodeArgs{
Input: "echo foo",
}, nil)
if err != nil {
return err
}
invokeBase64encode1, err := std.Base64encode(ctx, &std.Base64encodeArgs{
Input: "echo bar",
}, nil)
if err != nil {
return err
}
_, err = sagemaker.NewNotebookInstanceLifecycleConfiguration(ctx, "lc", &sagemaker.NotebookInstanceLifecycleConfigurationArgs{
Name: pulumi.String("foo"),
OnCreate: pulumi.String(invokeBase64encode.Result),
OnStart: pulumi.String(invokeBase64encode1.Result),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var lc = new Aws.Sagemaker.NotebookInstanceLifecycleConfiguration("lc", new()
{
Name = "foo",
OnCreate = Std.Base64encode.Invoke(new()
{
Input = "echo foo",
}).Apply(invoke => invoke.Result),
OnStart = Std.Base64encode.Invoke(new()
{
Input = "echo bar",
}).Apply(invoke => invoke.Result),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.sagemaker.NotebookInstanceLifecycleConfiguration;
import com.pulumi.aws.sagemaker.NotebookInstanceLifecycleConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var lc = new NotebookInstanceLifecycleConfiguration("lc", NotebookInstanceLifecycleConfigurationArgs.builder()
.name("foo")
.onCreate(StdFunctions.base64encode(Base64encodeArgs.builder()
.input("echo foo")
.build()).result())
.onStart(StdFunctions.base64encode(Base64encodeArgs.builder()
.input("echo bar")
.build()).result())
.build());
}
}
resources:
lc:
type: aws:sagemaker:NotebookInstanceLifecycleConfiguration
properties:
name: foo
onCreate:
fn::invoke:
Function: std:base64encode
Arguments:
input: echo foo
Return: result
onStart:
fn::invoke:
Function: std:base64encode
Arguments:
input: echo bar
Return: result
Create NotebookInstanceLifecycleConfiguration Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new NotebookInstanceLifecycleConfiguration(name: string, args?: NotebookInstanceLifecycleConfigurationArgs, opts?: CustomResourceOptions);
@overload
def NotebookInstanceLifecycleConfiguration(resource_name: str,
args: Optional[NotebookInstanceLifecycleConfigurationArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def NotebookInstanceLifecycleConfiguration(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
on_create: Optional[str] = None,
on_start: Optional[str] = None)
func NewNotebookInstanceLifecycleConfiguration(ctx *Context, name string, args *NotebookInstanceLifecycleConfigurationArgs, opts ...ResourceOption) (*NotebookInstanceLifecycleConfiguration, error)
public NotebookInstanceLifecycleConfiguration(string name, NotebookInstanceLifecycleConfigurationArgs? args = null, CustomResourceOptions? opts = null)
public NotebookInstanceLifecycleConfiguration(String name, NotebookInstanceLifecycleConfigurationArgs args)
public NotebookInstanceLifecycleConfiguration(String name, NotebookInstanceLifecycleConfigurationArgs args, CustomResourceOptions options)
type: aws:sagemaker:NotebookInstanceLifecycleConfiguration
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args NotebookInstanceLifecycleConfigurationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args NotebookInstanceLifecycleConfigurationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args NotebookInstanceLifecycleConfigurationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NotebookInstanceLifecycleConfigurationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NotebookInstanceLifecycleConfigurationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var notebookInstanceLifecycleConfigurationResource = new Aws.Sagemaker.NotebookInstanceLifecycleConfiguration("notebookInstanceLifecycleConfigurationResource", new()
{
Name = "string",
OnCreate = "string",
OnStart = "string",
});
example, err := sagemaker.NewNotebookInstanceLifecycleConfiguration(ctx, "notebookInstanceLifecycleConfigurationResource", &sagemaker.NotebookInstanceLifecycleConfigurationArgs{
Name: pulumi.String("string"),
OnCreate: pulumi.String("string"),
OnStart: pulumi.String("string"),
})
var notebookInstanceLifecycleConfigurationResource = new NotebookInstanceLifecycleConfiguration("notebookInstanceLifecycleConfigurationResource", NotebookInstanceLifecycleConfigurationArgs.builder()
.name("string")
.onCreate("string")
.onStart("string")
.build());
notebook_instance_lifecycle_configuration_resource = aws.sagemaker.NotebookInstanceLifecycleConfiguration("notebookInstanceLifecycleConfigurationResource",
name="string",
on_create="string",
on_start="string")
const notebookInstanceLifecycleConfigurationResource = new aws.sagemaker.NotebookInstanceLifecycleConfiguration("notebookInstanceLifecycleConfigurationResource", {
name: "string",
onCreate: "string",
onStart: "string",
});
type: aws:sagemaker:NotebookInstanceLifecycleConfiguration
properties:
name: string
onCreate: string
onStart: string
NotebookInstanceLifecycleConfiguration Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The NotebookInstanceLifecycleConfiguration resource accepts the following input properties:
- Name string
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- On
Create string - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- On
Start string - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
- Name string
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- On
Create string - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- On
Start string - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
- name String
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- on
Create String - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- on
Start String - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
- name string
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- on
Create string - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- on
Start string - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
- name str
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- on_
create str - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- on_
start str - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
- name String
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- on
Create String - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- on
Start String - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
Outputs
All input properties are implicitly available as output properties. Additionally, the NotebookInstanceLifecycleConfiguration resource produces the following output properties:
Look up Existing NotebookInstanceLifecycleConfiguration Resource
Get an existing NotebookInstanceLifecycleConfiguration resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: NotebookInstanceLifecycleConfigurationState, opts?: CustomResourceOptions): NotebookInstanceLifecycleConfiguration
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
name: Optional[str] = None,
on_create: Optional[str] = None,
on_start: Optional[str] = None) -> NotebookInstanceLifecycleConfiguration
func GetNotebookInstanceLifecycleConfiguration(ctx *Context, name string, id IDInput, state *NotebookInstanceLifecycleConfigurationState, opts ...ResourceOption) (*NotebookInstanceLifecycleConfiguration, error)
public static NotebookInstanceLifecycleConfiguration Get(string name, Input<string> id, NotebookInstanceLifecycleConfigurationState? state, CustomResourceOptions? opts = null)
public static NotebookInstanceLifecycleConfiguration get(String name, Output<String> id, NotebookInstanceLifecycleConfigurationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Arn string
- The Amazon Resource Name (ARN) assigned by AWS to this lifecycle configuration.
- Name string
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- On
Create string - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- On
Start string - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
- Arn string
- The Amazon Resource Name (ARN) assigned by AWS to this lifecycle configuration.
- Name string
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- On
Create string - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- On
Start string - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
- arn String
- The Amazon Resource Name (ARN) assigned by AWS to this lifecycle configuration.
- name String
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- on
Create String - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- on
Start String - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
- arn string
- The Amazon Resource Name (ARN) assigned by AWS to this lifecycle configuration.
- name string
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- on
Create string - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- on
Start string - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
- arn str
- The Amazon Resource Name (ARN) assigned by AWS to this lifecycle configuration.
- name str
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- on_
create str - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- on_
start str - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
- arn String
- The Amazon Resource Name (ARN) assigned by AWS to this lifecycle configuration.
- name String
- The name of the lifecycle configuration (must be unique). If omitted, this provider will assign a random, unique name.
- on
Create String - A shell script (base64-encoded) that runs only once when the SageMaker Notebook Instance is created.
- on
Start String - A shell script (base64-encoded) that runs every time the SageMaker Notebook Instance is started including the time it's created.
Import
Using pulumi import
, import models using the name
. For example:
$ pulumi import aws:sagemaker/notebookInstanceLifecycleConfiguration:NotebookInstanceLifecycleConfiguration lc foo
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.