Class NotebookInstance


  • public class NotebookInstance
    extends com.pulumi.resources.CustomResource
    Provides a SageMaker Notebook Instance resource. ## Example Usage ### Basic usage <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.sagemaker.NotebookInstance;
     import com.pulumi.aws.sagemaker.NotebookInstanceArgs;
     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 ni = new NotebookInstance("ni", NotebookInstanceArgs.builder()
                 .name("my-notebook-instance")
                 .roleArn(role.arn())
                 .instanceType("ml.t2.medium")
                 .tags(Map.of("Name", "foo"))
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ### Code repository usage <!--Start PulumiCodeChooser -->
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.sagemaker.CodeRepository;
     import com.pulumi.aws.sagemaker.CodeRepositoryArgs;
     import com.pulumi.aws.sagemaker.inputs.CodeRepositoryGitConfigArgs;
     import com.pulumi.aws.sagemaker.NotebookInstance;
     import com.pulumi.aws.sagemaker.NotebookInstanceArgs;
     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 example = new CodeRepository("example", CodeRepositoryArgs.builder()
                 .codeRepositoryName("my-notebook-instance-code-repo")
                 .gitConfig(CodeRepositoryGitConfigArgs.builder()
                     .repositoryUrl("https://github.com/github/docs.git")
                     .build())
                 .build());
     
             var ni = new NotebookInstance("ni", NotebookInstanceArgs.builder()
                 .name("my-notebook-instance")
                 .roleArn(role.arn())
                 .instanceType("ml.t2.medium")
                 .defaultCodeRepository(example.codeRepositoryName())
                 .tags(Map.of("Name", "foo"))
                 .build());
     
         }
     }
     
     
    <!--End PulumiCodeChooser --> ## Import Using `pulumi import`, import SageMaker Notebook Instances using the `name`. For example: ```sh $ pulumi import aws:sagemaker/notebookInstance:NotebookInstance test_notebook_instance my-notebook-instance ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> acceleratorTypes()  
      com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> additionalCodeRepositories()  
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> defaultCodeRepository()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> directInternetAccess()  
      static NotebookInstance get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, NotebookInstanceState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<NotebookInstanceInstanceMetadataServiceConfiguration>> instanceMetadataServiceConfiguration()  
      com.pulumi.core.Output<java.lang.String> instanceType()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyId()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> lifecycleConfigName()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<java.lang.String> networkInterfaceId()  
      com.pulumi.core.Output<java.lang.String> platformIdentifier()  
      com.pulumi.core.Output<java.lang.String> roleArn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> rootAccess()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> securityGroups()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> subnetId()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.lang.String> url()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> volumeSize()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NotebookInstance

        public NotebookInstance​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • NotebookInstance

        public NotebookInstance​(java.lang.String name,
                                NotebookInstanceArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • NotebookInstance

        public NotebookInstance​(java.lang.String name,
                                NotebookInstanceArgs args,
                                @Nullable
                                com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • acceleratorTypes

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> acceleratorTypes()
        Returns:
        A list of Elastic Inference (EI) instance types to associate with this notebook instance. See [Elastic Inference Accelerator](https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html) for more details. Valid values: `ml.eia1.medium`, `ml.eia1.large`, `ml.eia1.xlarge`, `ml.eia2.medium`, `ml.eia2.large`, `ml.eia2.xlarge`.
      • additionalCodeRepositories

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> additionalCodeRepositories()
        Returns:
        An array of up to three Git repositories to associate with the notebook instance. These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in [AWS CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance.
      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        The Amazon Resource Name (ARN) assigned by AWS to this notebook instance.
      • defaultCodeRepository

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> defaultCodeRepository()
        Returns:
        The Git repository associated with the notebook instance as its default code repository. This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in [AWS CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) or in any other Git repository.
      • directInternetAccess

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> directInternetAccess()
        Returns:
        Set to `Disabled` to disable internet access to notebook. Requires `security_groups` and `subnet_id` to be set. Supported values: `Enabled` (Default) or `Disabled`. If set to `Disabled`, the notebook instance will be able to access resources only in your VPC, and will not be able to connect to Amazon SageMaker training and endpoint services unless your configure a NAT Gateway in your VPC.
      • instanceMetadataServiceConfiguration

        public com.pulumi.core.Output<java.util.Optional<NotebookInstanceInstanceMetadataServiceConfiguration>> instanceMetadataServiceConfiguration()
        Returns:
        Information on the IMDS configuration of the notebook instance. Conflicts with `instance_metadata_service_configuration`. see details below.
      • instanceType

        public com.pulumi.core.Output<java.lang.String> instanceType()
        Returns:
        The name of ML compute instance type.
      • kmsKeyId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> kmsKeyId()
        Returns:
        The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to encrypt the model artifacts at rest using Amazon S3 server-side encryption.
      • lifecycleConfigName

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> lifecycleConfigName()
        Returns:
        The name of a lifecycle configuration to associate with the notebook instance.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name of the notebook instance (must be unique).
      • networkInterfaceId

        public com.pulumi.core.Output<java.lang.String> networkInterfaceId()
        Returns:
        The network interface ID that Amazon SageMaker created at the time of creating the instance. Only available when setting `subnet_id`.
      • platformIdentifier

        public com.pulumi.core.Output<java.lang.String> platformIdentifier()
        Returns:
        The platform identifier of the notebook instance runtime environment. This value can be either `notebook-al1-v1`, `notebook-al2-v1`, or `notebook-al2-v2`, depending on which version of Amazon Linux you require.
      • roleArn

        public com.pulumi.core.Output<java.lang.String> roleArn()
        Returns:
        The ARN of the IAM role to be used by the notebook instance which allows SageMaker to call other services on your behalf.
      • rootAccess

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> rootAccess()
        Returns:
        Whether root access is `Enabled` or `Disabled` for users of the notebook instance. The default value is `Enabled`.
      • securityGroups

        public com.pulumi.core.Output<java.util.List<java.lang.String>> securityGroups()
        Returns:
        The associated security groups.
      • subnetId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> subnetId()
        Returns:
        The VPC subnet ID.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
      • url

        public com.pulumi.core.Output<java.lang.String> url()
        Returns:
        The URL that you use to connect to the Jupyter notebook that is running in your notebook instance.
      • volumeSize

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> volumeSize()
        Returns:
        The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB.
      • get

        public static NotebookInstance get​(java.lang.String name,
                                           com.pulumi.core.Output<java.lang.String> id,
                                           @Nullable
                                           NotebookInstanceState state,
                                           @Nullable
                                           com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.