Delete or stop your Studio running instances, applications, and spaces - Amazon SageMaker

Delete or stop your Studio running instances, applications, and spaces

To avoid additional charges from unused Studio running instances, applications, or spaces, you can stop or delete them. This page will provide some information about the differences between stopping or deleting your Studio running instances, applications, or spaces, followed by instructions.

We briefly give an overview of the differences between a space, application, and instance in the following bullet points:

  • When you create a space, you are creating the necessary resources to run an application. This includes an Amazon Elastic Block Store (Amazon EBS) volume where your data is stored. When you delete a space, you are also deleting your data stored in the space.

  • When you open an application, you will need to start an instance for the application to run on.

    When you close an application, you will not automatically stop and delete the instance. You can reopen the application while the instance is running.

    When you use the DeleteApp API you also stop and delete the instance. You can restart the instance and application after using this API.

  • For the instructions on this page, the action to stop an instance or delete an instance has the same effect. When you stop or delete an instance, you also stop the application.

    Similarly, to stop an instance is the same as to stop or delete an application.

Note

If the service detects that an application is unhealthy, it assumes the AmazonSageMakerNotebooksServiceRolePolicy service linked role and deletes the application using the DeleteApp API.

For more information about the differences between Studio spaces, application, and instances, see View your Studio running instances, applications, and spaces.

Delete or stop your Amazon SageMaker Studio application or running instance

To avoid additional charges from unused running applications, you can stop and delete those applications and running instances. The following provides some information on stopping or deleting an application or instance:

  • In the following instructions, to delete an application (uses the DeleteApp API) has the same effect as to stop the instance for the application. Following the instructions to delete an application or stop an instance, both stops and deletes the application and the instance for the application.

  • After you delete an application or stop an instance, you can start up the instance and application again later.

    • When you delete an application or stop an instance, the files in the space will persist. You can run the application again and expect to have access to the same files that are stored in the space, as you did before deleting the application.

    • When you delete an application or stop an instance, the metadata for the application will be deleted within 24 hours. For more information, see the note in the CreationTime response element for the DescribeApp API.

The following tabs provide instructions to stop and delete an application from your domain using the Studio UI, the SageMaker console, or the AWS CLI.

Note

To view and stop all of your Studio running instances in one location, we recommend the Use the Studio UI to delete your domain applications workflow from the following options.

To delete your Studio applications using the Studio UI, use the following instructions.

To delete your domain applications (Studio UI)
  1. Launch Studio. This process may differ depending on your setup. For information about launching Studio, see Launch Amazon SageMaker Studio.

  2. From the left navigation pane, choose Running instances.

    If the table on the page is empty, you don't have any running instances or applications in your spaces.

  3. In the table under the Name and Application columns, find the space name and the application that you want to stop and delete.

  4. Choose the corresponding Stop button to stop and delete the application.

To view or stop Studio running instances from a centralized location, see Use the Studio UI to delete your domain applications. Otherwise, use the following instructions.

In the SageMaker console, you can only stop the running Studio applications for the spaces that you are able to view in the Spaces section of the console. For a list of the viewable spaces, see View your Studio spaces.

These steps show how to delete your Studio applications by using the SageMaker console.

To delete applications instructions (console)
  1. Open the Amazon SageMaker console at https://console.aws.amazon.com/sagemaker/.

  2. From the left navigation pane, expand Admin configurations and choose Domains.

  3. Choose the domain that you want to revert.

  4. On the Domain details page, choose the Space management tab.

  5. Important

    In the Space management tab, you have the option to delete the space. There is a difference between deleting the space and deleting an application. If you delete the space, you will lose access to the data within that space. Do not delete the space unless you're sure that you want to.

    To stop and delete the application, in the Space management tab and under the Name column, choose the space for the application.

  6. In the Apps section and under the App type column, search for the app to stop and delete.

  7. Under the Action column, choose the corresponding Delete app button.

  8. In the pop-up box, choose Yes, delete app. After you do so the delete input field becomes available.

  9. Enter delete in the delete input field to confirm deletion.

  10. Choose Delete.

To view or stop any of your Studio running instances from a centralized location, see Use the Studio UI to delete your domain applications. Otherwise, use the following instructions.

The following code examples use the DeleteApp API to delete an application in an example domain.

To stop your running JupyterLab or Code Editor instances, use the following code example:

aws sagemaker delete-app \ --domain-id example-domain-id \ --region AWS Region \ --app-name default \ --app-type example-app-type \ --space-name example-space-name
  • To obtain your example-domain-id, use the following instructions:

    To get example-domain-id
    1. Open the Amazon SageMaker console at https://console.aws.amazon.com/sagemaker/.

    2. From the left navigation pane, expand Admin configurations and choose Domains.

    3. Choose the relevant domain.

    4. On the Domain details page, choose the Domain settings tab.

    5. Copy the Domain ID.

  • To obtain your AWS Region, use the following instructions to ensure you are using the correct AWS Region for your domain:

    To get AWS Region
    1. Open the Amazon SageMaker console at https://console.aws.amazon.com/sagemaker/.

    2. From the left navigation pane, expand Admin configurations and choose Domains.

    3. Choose the relevant domain.

    4. On the Domain details page, verify that this is the relevant domain.

    5. Expand the region dropdown list from the top right of the SageMaker console, and use the corresponding AWS Region ID to the right of your AWS Region name. For example, us-west-1.

  • For example-app-type, use the application type that's relevant to the application that you want to stop. For example, replace example-app-type with one of the following application types:

  • To obtain your example-space-name, use the following steps:

    To get example-space-name
    1. Open the Amazon SageMaker console at https://console.aws.amazon.com/sagemaker/.

    2. From the left navigation pane, expand Admin configurations and choose Domains.

    3. Choose the relevant domain.

    4. On the Domain details page, choose the Space management tab.

    5. Copy the relevant space name.

To stop running instances for SageMaker Canvas, Studio Classic, or RStudio, use the following code example:

aws sagemaker delete-app \ --domain-id example-domain-id \ --region AWS Region \ --app-name default \ --app-type example-app-type \ --user-profile example-user-name
  • For example-app-type, use the application type relevant to the application that you want to stop. For example, replace example-app-type with one of the following application types:

  • To obtain your example-user-name, navigate to the Domain details page.

    • Next, choose the User profiles tab, and copy the relevant space name.

For alternative instructions to delete your running Studio applications, see:

Delete a Studio space

Important

After you delete your space, you will lose all of the data stored in the space. We recommend that you back up your data before deleting your space.

To delete a Studio space, you will need to have administrator permissions or at least have permissions to update domain, IAM and Amazon S3.

  • Spaces are used to manage the storage and resource needs of the relevant application. When you delete a space, the storage volume also deletes. Therefore, you lose access to the files stored on that space. For more information about Studio spaces, see Amazon SageMaker Studio spaces.

    We recommend that you back up your data if you choose to delete a space.

  • After you delete a space, you can't access that space again.

You can delete the Studio spaces that are viewable in the Spaces section of the console. For a list of the viewable spaces, see View your Studio spaces.

There are no spaces for SageMaker Canvas, Studio Classic (private), and RStudio. To stop and delete your SageMaker Canvas, Studio Classic (private), or RStudio applications, see Delete or stop your Amazon SageMaker Studio application or running instance.

The Spaces section within your Domain details page gives information about Studio spaces within you domain. You can view, create, and delete spaces on this page.

To view Studio spaces in a domain
  1. Open the Amazon SageMaker console at https://console.aws.amazon.com/sagemaker/.

  2. From the left navigation pane, expand Admin configurations and choose Domains.

  3. Choose the domain where you want to view the spaces.

  4. On the Domain details, choose Space management to open the Spaces section.

  5. Select the space to delete.

  6. Choose Delete.

  7. In the pop-up box titled Delete space, you have two options:

    • If you already shut down all applications in the space, choose Yes, delete space.

    • If you still have applications running in the space, choose Yes, shut down all apps and delete space.

  8. Enter delete in the delete input field to confirm deletion.

  9. To delete the space, you have two options:

    • If you already shut down all applications in the space, choose Delete space.

    • If you still have applications running in the space, choose Shut down all apps and delete space.

Before you can delete a space using the AWS CLI, you must delete the application associated with it. For information about stopping your Studio applications, see Delete or stop your Amazon SageMaker Studio application or running instance.

Use the following AWS CLI command to delete a space within a domain:

aws sagemaker delete-space \ --domain-id example-domain-id \ --region AWS Region \ --space-name example-space-name
  • To obtain your example-domain-id, use the following instructions:

    To get example-domain-id
    1. Open the Amazon SageMaker console at https://console.aws.amazon.com/sagemaker/.

    2. From the left navigation pane, expand Admin configurations and choose Domains.

    3. Choose the relevant domain.

    4. On the Domain details page, choose the Domain settings tab.

    5. Copy the Domain ID.

  • To obtain your AWS Region, use the following instructions to ensure you are using the correct AWS Region for your domain:

    To get AWS Region
    1. Open the Amazon SageMaker console at https://console.aws.amazon.com/sagemaker/.

    2. From the left navigation pane, expand Admin configurations and choose Domains.

    3. Choose the relevant domain.

    4. On the Domain details page, verify that this is the relevant domain.

    5. Expand the region dropdown list from the top right of the SageMaker console, and use the corresponding AWS Region ID to the right of your AWS Region name. For example, us-west-1.

  • To obtain your example-space-name, use the following steps:

    To get example-space-name
    1. Open the Amazon SageMaker console at https://console.aws.amazon.com/sagemaker/.

    2. From the left navigation pane, expand Admin configurations and choose Domains.

    3. Choose the relevant domain.

    4. On the Domain details page, choose the Space management tab.

    5. Copy the relevant space name.