Amazon SageMaker Service

2022/04/07 - Amazon SageMaker Service - 4 updated api methods

Changes  Amazon Sagemaker Notebook Instances now supports G5 instance types

CreateNotebookInstance (updated) Link ¶
Changes (request)
{'InstanceType': {'ml.g5.12xlarge',
                  'ml.g5.16xlarge',
                  'ml.g5.24xlarge',
                  'ml.g5.2xlarge',
                  'ml.g5.48xlarge',
                  'ml.g5.4xlarge',
                  'ml.g5.8xlarge',
                  'ml.g5.xlarge'}}

Creates an Amazon SageMaker notebook instance. A notebook instance is a machine learning (ML) compute instance running on a Jupyter notebook.

In a CreateNotebookInstance request, specify the type of ML compute instance that you want to run. Amazon SageMaker launches the instance, installs common libraries that you can use to explore datasets for model training, and attaches an ML storage volume to the notebook instance.

Amazon SageMaker also provides a set of example notebooks. Each notebook demonstrates how to use Amazon SageMaker with a specific algorithm or with a machine learning framework.

After receiving the request, Amazon SageMaker does the following:

  • Creates a network interface in the Amazon SageMaker VPC.

  • (Option) If you specified SubnetId , Amazon SageMaker creates a network interface in your own VPC, which is inferred from the subnet ID that you provide in the input. When creating this network interface, Amazon SageMaker attaches the security group that you specified in the request to the network interface that it creates in your VPC.

  • Launches an EC2 instance of the type specified in the request in the Amazon SageMaker VPC. If you specified SubnetId of your VPC, Amazon SageMaker specifies both network interfaces when launching this instance. This enables inbound traffic from your own VPC to the notebook instance, assuming that the security groups allow it.

After creating the notebook instance, Amazon SageMaker returns its Amazon Resource Name (ARN). You can't change the name of a notebook instance after you create it.

After Amazon SageMaker creates the notebook instance, you can connect to the Jupyter server and work in Jupyter notebooks. For example, you can write code to explore a dataset that you can use for model training, train a model, host models by creating Amazon SageMaker endpoints, and validate hosted models.

For more information, see How It Works.

See also: AWS API Documentation

Request Syntax

client.create_notebook_instance(
    NotebookInstanceName='string',
    InstanceType='ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.m5d.large'|'ml.m5d.xlarge'|'ml.m5d.2xlarge'|'ml.m5d.4xlarge'|'ml.m5d.8xlarge'|'ml.m5d.12xlarge'|'ml.m5d.16xlarge'|'ml.m5d.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p3dn.24xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.r5.large'|'ml.r5.xlarge'|'ml.r5.2xlarge'|'ml.r5.4xlarge'|'ml.r5.8xlarge'|'ml.r5.12xlarge'|'ml.r5.16xlarge'|'ml.r5.24xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.16xlarge'|'ml.g5.12xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge',
    SubnetId='string',
    SecurityGroupIds=[
        'string',
    ],
    RoleArn='string',
    KmsKeyId='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    LifecycleConfigName='string',
    DirectInternetAccess='Enabled'|'Disabled',
    VolumeSizeInGB=123,
    AcceleratorTypes=[
        'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge'|'ml.eia2.medium'|'ml.eia2.large'|'ml.eia2.xlarge',
    ],
    DefaultCodeRepository='string',
    AdditionalCodeRepositories=[
        'string',
    ],
    RootAccess='Enabled'|'Disabled',
    PlatformIdentifier='string'
)
type NotebookInstanceName

string

param NotebookInstanceName

[REQUIRED]

The name of the new notebook instance.

type InstanceType

string

param InstanceType

[REQUIRED]

The type of ML compute instance to launch for the notebook instance.

type SubnetId

string

param SubnetId

The ID of the subnet in a VPC to which you would like to have a connectivity from your ML compute instance.

type SecurityGroupIds

list

param SecurityGroupIds

The VPC security group IDs, in the form sg-xxxxxxxx. The security groups must be for the same VPC as specified in the subnet.

  • (string) --

type RoleArn

string

param RoleArn

[REQUIRED]

When you send any requests to Amazon Web Services resources from the notebook instance, Amazon SageMaker assumes this role to perform tasks on your behalf. You must grant this role necessary permissions so Amazon SageMaker can perform these tasks. The policy must allow the Amazon SageMaker service principal (sagemaker.amazonaws.com) permissions to assume this role. For more information, see Amazon SageMaker Roles.

Note

To be able to pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission.

type KmsKeyId

string

param KmsKeyId

The Amazon Resource Name (ARN) of a Amazon Web Services Key Management Service key that Amazon SageMaker uses to encrypt data on the storage volume attached to your notebook instance. The KMS key you provide must be enabled. For information, see Enabling and Disabling Keys in the Amazon Web Services Key Management Service Developer Guide .

type Tags

list

param Tags

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.

  • (dict) --

    A tag object that consists of a key and an optional value, used to manage metadata for SageMaker Amazon Web Services resources.

    You can add tags to notebook instances, training jobs, hyperparameter tuning jobs, batch transform jobs, models, labeling jobs, work teams, endpoint configurations, and endpoints. For more information on adding tags to SageMaker resources, see AddTags.

    For more information on adding metadata to your Amazon Web Services resources with tagging, see Tagging Amazon Web Services resources. For advice on best practices for managing Amazon Web Services resources with tagging, see Tagging Best Practices: Implement an Effective Amazon Web Services Resource Tagging Strategy.

    • Key (string) -- [REQUIRED]

      The tag key. Tag keys must be unique per resource.

    • Value (string) -- [REQUIRED]

      The tag value.

type LifecycleConfigName

string

param LifecycleConfigName

The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.

type DirectInternetAccess

string

param DirectInternetAccess

Sets whether Amazon SageMaker provides internet access to the notebook instance. If you set this to Disabled this notebook instance is able to access resources only in your VPC, and is not be able to connect to Amazon SageMaker training and endpoint services unless you configure a NAT Gateway in your VPC.

For more information, see Notebook Instances Are Internet-Enabled by Default. You can set the value of this parameter to Disabled only if you set a value for the SubnetId parameter.

type VolumeSizeInGB

integer

param VolumeSizeInGB

The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB.

type AcceleratorTypes

list

param AcceleratorTypes

A list of Elastic Inference (EI) instance types to associate with this notebook instance. Currently, only one instance type can be associated with a notebook instance. For more information, see Using Elastic Inference in Amazon SageMaker.

  • (string) --

type DefaultCodeRepository

string

param DefaultCodeRepository

A Git repository to associate 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 Amazon Web Services CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

type AdditionalCodeRepositories

list

param AdditionalCodeRepositories

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 Amazon Web Services CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

  • (string) --

type RootAccess

string

param RootAccess

Whether root access is enabled or disabled for users of the notebook instance. The default value is Enabled .

Note

Lifecycle configurations need root access to be able to set up a notebook instance. Because of this, lifecycle configurations associated with a notebook instance always run with root access even if you disable root access for users.

type PlatformIdentifier

string

param PlatformIdentifier

The platform identifier of the notebook instance runtime environment.

rtype

dict

returns

Response Syntax

{
    'NotebookInstanceArn': 'string'
}

Response Structure

  • (dict) --

    • NotebookInstanceArn (string) --

      The Amazon Resource Name (ARN) of the notebook instance.

DescribeNotebookInstance (updated) Link ¶
Changes (response)
{'InstanceType': {'ml.g5.12xlarge',
                  'ml.g5.16xlarge',
                  'ml.g5.24xlarge',
                  'ml.g5.2xlarge',
                  'ml.g5.48xlarge',
                  'ml.g5.4xlarge',
                  'ml.g5.8xlarge',
                  'ml.g5.xlarge'}}

Returns information about a notebook instance.

See also: AWS API Documentation

Request Syntax

client.describe_notebook_instance(
    NotebookInstanceName='string'
)
type NotebookInstanceName

string

param NotebookInstanceName

[REQUIRED]

The name of the notebook instance that you want information about.

rtype

dict

returns

Response Syntax

{
    'NotebookInstanceArn': 'string',
    'NotebookInstanceName': 'string',
    'NotebookInstanceStatus': 'Pending'|'InService'|'Stopping'|'Stopped'|'Failed'|'Deleting'|'Updating',
    'FailureReason': 'string',
    'Url': 'string',
    'InstanceType': 'ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.m5d.large'|'ml.m5d.xlarge'|'ml.m5d.2xlarge'|'ml.m5d.4xlarge'|'ml.m5d.8xlarge'|'ml.m5d.12xlarge'|'ml.m5d.16xlarge'|'ml.m5d.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p3dn.24xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.r5.large'|'ml.r5.xlarge'|'ml.r5.2xlarge'|'ml.r5.4xlarge'|'ml.r5.8xlarge'|'ml.r5.12xlarge'|'ml.r5.16xlarge'|'ml.r5.24xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.16xlarge'|'ml.g5.12xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge',
    'SubnetId': 'string',
    'SecurityGroups': [
        'string',
    ],
    'RoleArn': 'string',
    'KmsKeyId': 'string',
    'NetworkInterfaceId': 'string',
    'LastModifiedTime': datetime(2015, 1, 1),
    'CreationTime': datetime(2015, 1, 1),
    'NotebookInstanceLifecycleConfigName': 'string',
    'DirectInternetAccess': 'Enabled'|'Disabled',
    'VolumeSizeInGB': 123,
    'AcceleratorTypes': [
        'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge'|'ml.eia2.medium'|'ml.eia2.large'|'ml.eia2.xlarge',
    ],
    'DefaultCodeRepository': 'string',
    'AdditionalCodeRepositories': [
        'string',
    ],
    'RootAccess': 'Enabled'|'Disabled',
    'PlatformIdentifier': 'string'
}

Response Structure

  • (dict) --

    • NotebookInstanceArn (string) --

      The Amazon Resource Name (ARN) of the notebook instance.

    • NotebookInstanceName (string) --

      The name of the Amazon SageMaker notebook instance.

    • NotebookInstanceStatus (string) --

      The status of the notebook instance.

    • FailureReason (string) --

      If status is Failed , the reason it failed.

    • Url (string) --

      The URL that you use to connect to the Jupyter notebook that is running in your notebook instance.

    • InstanceType (string) --

      The type of ML compute instance running on the notebook instance.

    • SubnetId (string) --

      The ID of the VPC subnet.

    • SecurityGroups (list) --

      The IDs of the VPC security groups.

      • (string) --

    • RoleArn (string) --

      The Amazon Resource Name (ARN) of the IAM role associated with the instance.

    • KmsKeyId (string) --

      The Amazon Web Services KMS key ID Amazon SageMaker uses to encrypt data when storing it on the ML storage volume attached to the instance.

    • NetworkInterfaceId (string) --

      The network interface IDs that Amazon SageMaker created at the time of creating the instance.

    • LastModifiedTime (datetime) --

      A timestamp. Use this parameter to retrieve the time when the notebook instance was last modified.

    • CreationTime (datetime) --

      A timestamp. Use this parameter to return the time when the notebook instance was created

    • NotebookInstanceLifecycleConfigName (string) --

      Returns the name of a notebook instance lifecycle configuration.

      For information about notebook instance lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance

    • DirectInternetAccess (string) --

      Describes whether Amazon SageMaker provides internet access to the notebook instance. If this value is set to Disabled , the notebook instance does not have internet access, and cannot connect to Amazon SageMaker training and endpoint services.

      For more information, see Notebook Instances Are Internet-Enabled by Default.

    • VolumeSizeInGB (integer) --

      The size, in GB, of the ML storage volume attached to the notebook instance.

    • AcceleratorTypes (list) --

      A list of the Elastic Inference (EI) instance types associated with this notebook instance. Currently only one EI instance type can be associated with a notebook instance. For more information, see Using Elastic Inference in Amazon SageMaker.

      • (string) --

    • DefaultCodeRepository (string) --

      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 Amazon Web Services CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

    • AdditionalCodeRepositories (list) --

      An array of up to three Git repositories associated 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 Amazon Web Services CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

      • (string) --

    • RootAccess (string) --

      Whether root access is enabled or disabled for users of the notebook instance.

      Note

      Lifecycle configurations need root access to be able to set up a notebook instance. Because of this, lifecycle configurations associated with a notebook instance always run with root access even if you disable root access for users.

    • PlatformIdentifier (string) --

      The platform identifier of the notebook instance runtime environment.

ListNotebookInstances (updated) Link ¶
Changes (response)
{'NotebookInstances': {'InstanceType': {'ml.g5.12xlarge',
                                        'ml.g5.16xlarge',
                                        'ml.g5.24xlarge',
                                        'ml.g5.2xlarge',
                                        'ml.g5.48xlarge',
                                        'ml.g5.4xlarge',
                                        'ml.g5.8xlarge',
                                        'ml.g5.xlarge'}}}

Returns a list of the Amazon SageMaker notebook instances in the requester's account in an Amazon Web Services Region.

See also: AWS API Documentation

Request Syntax

client.list_notebook_instances(
    NextToken='string',
    MaxResults=123,
    SortBy='Name'|'CreationTime'|'Status',
    SortOrder='Ascending'|'Descending',
    NameContains='string',
    CreationTimeBefore=datetime(2015, 1, 1),
    CreationTimeAfter=datetime(2015, 1, 1),
    LastModifiedTimeBefore=datetime(2015, 1, 1),
    LastModifiedTimeAfter=datetime(2015, 1, 1),
    StatusEquals='Pending'|'InService'|'Stopping'|'Stopped'|'Failed'|'Deleting'|'Updating',
    NotebookInstanceLifecycleConfigNameContains='string',
    DefaultCodeRepositoryContains='string',
    AdditionalCodeRepositoryEquals='string'
)
type NextToken

string

param NextToken

If the previous call to the ListNotebookInstances is truncated, the response includes a NextToken . You can use this token in your subsequent ListNotebookInstances request to fetch the next set of notebook instances.

Note

You might specify a filter or a sort order in your request. When response is truncated, you must use the same values for the filer and sort order in the next request.

type MaxResults

integer

param MaxResults

The maximum number of notebook instances to return.

type SortBy

string

param SortBy

The field to sort results by. The default is Name .

type SortOrder

string

param SortOrder

The sort order for results.

type NameContains

string

param NameContains

A string in the notebook instances' name. This filter returns only notebook instances whose name contains the specified string.

type CreationTimeBefore

datetime

param CreationTimeBefore

A filter that returns only notebook instances that were created before the specified time (timestamp).

type CreationTimeAfter

datetime

param CreationTimeAfter

A filter that returns only notebook instances that were created after the specified time (timestamp).

type LastModifiedTimeBefore

datetime

param LastModifiedTimeBefore

A filter that returns only notebook instances that were modified before the specified time (timestamp).

type LastModifiedTimeAfter

datetime

param LastModifiedTimeAfter

A filter that returns only notebook instances that were modified after the specified time (timestamp).

type StatusEquals

string

param StatusEquals

A filter that returns only notebook instances with the specified status.

type NotebookInstanceLifecycleConfigNameContains

string

param NotebookInstanceLifecycleConfigNameContains

A string in the name of a notebook instances lifecycle configuration associated with this notebook instance. This filter returns only notebook instances associated with a lifecycle configuration with a name that contains the specified string.

type DefaultCodeRepositoryContains

string

param DefaultCodeRepositoryContains

A string in the name or URL of a Git repository associated with this notebook instance. This filter returns only notebook instances associated with a git repository with a name that contains the specified string.

type AdditionalCodeRepositoryEquals

string

param AdditionalCodeRepositoryEquals

A filter that returns only notebook instances with associated with the specified git repository.

rtype

dict

returns

Response Syntax

{
    'NextToken': 'string',
    'NotebookInstances': [
        {
            'NotebookInstanceName': 'string',
            'NotebookInstanceArn': 'string',
            'NotebookInstanceStatus': 'Pending'|'InService'|'Stopping'|'Stopped'|'Failed'|'Deleting'|'Updating',
            'Url': 'string',
            'InstanceType': 'ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.m5d.large'|'ml.m5d.xlarge'|'ml.m5d.2xlarge'|'ml.m5d.4xlarge'|'ml.m5d.8xlarge'|'ml.m5d.12xlarge'|'ml.m5d.16xlarge'|'ml.m5d.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p3dn.24xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.r5.large'|'ml.r5.xlarge'|'ml.r5.2xlarge'|'ml.r5.4xlarge'|'ml.r5.8xlarge'|'ml.r5.12xlarge'|'ml.r5.16xlarge'|'ml.r5.24xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.16xlarge'|'ml.g5.12xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge',
            'CreationTime': datetime(2015, 1, 1),
            'LastModifiedTime': datetime(2015, 1, 1),
            'NotebookInstanceLifecycleConfigName': 'string',
            'DefaultCodeRepository': 'string',
            'AdditionalCodeRepositories': [
                'string',
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      If the response to the previous ListNotebookInstances request was truncated, Amazon SageMaker returns this token. To retrieve the next set of notebook instances, use the token in the next request.

    • NotebookInstances (list) --

      An array of NotebookInstanceSummary objects, one for each notebook instance.

      • (dict) --

        Provides summary information for an Amazon SageMaker notebook instance.

        • NotebookInstanceName (string) --

          The name of the notebook instance that you want a summary for.

        • NotebookInstanceArn (string) --

          The Amazon Resource Name (ARN) of the notebook instance.

        • NotebookInstanceStatus (string) --

          The status of the notebook instance.

        • Url (string) --

          The URL that you use to connect to the Jupyter instance running in your notebook instance.

        • InstanceType (string) --

          The type of ML compute instance that the notebook instance is running on.

        • CreationTime (datetime) --

          A timestamp that shows when the notebook instance was created.

        • LastModifiedTime (datetime) --

          A timestamp that shows when the notebook instance was last modified.

        • NotebookInstanceLifecycleConfigName (string) --

          The name of a notebook instance lifecycle configuration associated with this notebook instance.

          For information about notebook instance lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.

        • DefaultCodeRepository (string) --

          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 Amazon Web Services CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

        • AdditionalCodeRepositories (list) --

          An array of up to three Git repositories associated 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 Amazon Web Services CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

          • (string) --

UpdateNotebookInstance (updated) Link ¶
Changes (request)
{'InstanceType': {'ml.g5.12xlarge',
                  'ml.g5.16xlarge',
                  'ml.g5.24xlarge',
                  'ml.g5.2xlarge',
                  'ml.g5.48xlarge',
                  'ml.g5.4xlarge',
                  'ml.g5.8xlarge',
                  'ml.g5.xlarge'}}

Updates a notebook instance. NotebookInstance updates include upgrading or downgrading the ML compute instance used for your notebook instance to accommodate changes in your workload requirements.

See also: AWS API Documentation

Request Syntax

client.update_notebook_instance(
    NotebookInstanceName='string',
    InstanceType='ml.t2.medium'|'ml.t2.large'|'ml.t2.xlarge'|'ml.t2.2xlarge'|'ml.t3.medium'|'ml.t3.large'|'ml.t3.xlarge'|'ml.t3.2xlarge'|'ml.m4.xlarge'|'ml.m4.2xlarge'|'ml.m4.4xlarge'|'ml.m4.10xlarge'|'ml.m4.16xlarge'|'ml.m5.xlarge'|'ml.m5.2xlarge'|'ml.m5.4xlarge'|'ml.m5.12xlarge'|'ml.m5.24xlarge'|'ml.m5d.large'|'ml.m5d.xlarge'|'ml.m5d.2xlarge'|'ml.m5d.4xlarge'|'ml.m5d.8xlarge'|'ml.m5d.12xlarge'|'ml.m5d.16xlarge'|'ml.m5d.24xlarge'|'ml.c4.xlarge'|'ml.c4.2xlarge'|'ml.c4.4xlarge'|'ml.c4.8xlarge'|'ml.c5.xlarge'|'ml.c5.2xlarge'|'ml.c5.4xlarge'|'ml.c5.9xlarge'|'ml.c5.18xlarge'|'ml.c5d.xlarge'|'ml.c5d.2xlarge'|'ml.c5d.4xlarge'|'ml.c5d.9xlarge'|'ml.c5d.18xlarge'|'ml.p2.xlarge'|'ml.p2.8xlarge'|'ml.p2.16xlarge'|'ml.p3.2xlarge'|'ml.p3.8xlarge'|'ml.p3.16xlarge'|'ml.p3dn.24xlarge'|'ml.g4dn.xlarge'|'ml.g4dn.2xlarge'|'ml.g4dn.4xlarge'|'ml.g4dn.8xlarge'|'ml.g4dn.12xlarge'|'ml.g4dn.16xlarge'|'ml.r5.large'|'ml.r5.xlarge'|'ml.r5.2xlarge'|'ml.r5.4xlarge'|'ml.r5.8xlarge'|'ml.r5.12xlarge'|'ml.r5.16xlarge'|'ml.r5.24xlarge'|'ml.g5.xlarge'|'ml.g5.2xlarge'|'ml.g5.4xlarge'|'ml.g5.8xlarge'|'ml.g5.16xlarge'|'ml.g5.12xlarge'|'ml.g5.24xlarge'|'ml.g5.48xlarge',
    RoleArn='string',
    LifecycleConfigName='string',
    DisassociateLifecycleConfig=True|False,
    VolumeSizeInGB=123,
    DefaultCodeRepository='string',
    AdditionalCodeRepositories=[
        'string',
    ],
    AcceleratorTypes=[
        'ml.eia1.medium'|'ml.eia1.large'|'ml.eia1.xlarge'|'ml.eia2.medium'|'ml.eia2.large'|'ml.eia2.xlarge',
    ],
    DisassociateAcceleratorTypes=True|False,
    DisassociateDefaultCodeRepository=True|False,
    DisassociateAdditionalCodeRepositories=True|False,
    RootAccess='Enabled'|'Disabled'
)
type NotebookInstanceName

string

param NotebookInstanceName

[REQUIRED]

The name of the notebook instance to update.

type InstanceType

string

param InstanceType

The Amazon ML compute instance type.

type RoleArn

string

param RoleArn

The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker can assume to access the notebook instance. For more information, see Amazon SageMaker Roles.

Note

To be able to pass this role to Amazon SageMaker, the caller of this API must have the iam:PassRole permission.

type LifecycleConfigName

string

param LifecycleConfigName

The name of a lifecycle configuration to associate with the notebook instance. For information about lifestyle configurations, see Step 2.1: (Optional) Customize a Notebook Instance.

type DisassociateLifecycleConfig

boolean

param DisassociateLifecycleConfig

Set to true to remove the notebook instance lifecycle configuration currently associated with the notebook instance. This operation is idempotent. If you specify a lifecycle configuration that is not associated with the notebook instance when you call this method, it does not throw an error.

type VolumeSizeInGB

integer

param VolumeSizeInGB

The size, in GB, of the ML storage volume to attach to the notebook instance. The default value is 5 GB. ML storage volumes are encrypted, so Amazon SageMaker can't determine the amount of available free space on the volume. Because of this, you can increase the volume size when you update a notebook instance, but you can't decrease the volume size. If you want to decrease the size of the ML storage volume in use, create a new notebook instance with the desired size.

type DefaultCodeRepository

string

param DefaultCodeRepository

The Git repository to associate 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 Amazon Web Services CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

type AdditionalCodeRepositories

list

param AdditionalCodeRepositories

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 Amazon Web Services CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with Amazon SageMaker Notebook Instances.

  • (string) --

type AcceleratorTypes

list

param AcceleratorTypes

A list of the Elastic Inference (EI) instance types to associate with this notebook instance. Currently only one EI instance type can be associated with a notebook instance. For more information, see Using Elastic Inference in Amazon SageMaker.

  • (string) --

type DisassociateAcceleratorTypes

boolean

param DisassociateAcceleratorTypes

A list of the Elastic Inference (EI) instance types to remove from this notebook instance. This operation is idempotent. If you specify an accelerator type that is not associated with the notebook instance when you call this method, it does not throw an error.

type DisassociateDefaultCodeRepository

boolean

param DisassociateDefaultCodeRepository

The name or URL of the default Git repository to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.

type DisassociateAdditionalCodeRepositories

boolean

param DisassociateAdditionalCodeRepositories

A list of names or URLs of the default Git repositories to remove from this notebook instance. This operation is idempotent. If you specify a Git repository that is not associated with the notebook instance when you call this method, it does not throw an error.

type RootAccess

string

param RootAccess

Whether root access is enabled or disabled for users of the notebook instance. The default value is Enabled .

Note

If you set this to Disabled , users don't have root access on the notebook instance, but lifecycle configuration scripts still run with root permissions.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --