

# Amazon SageMaker Studio spaces


**Important**  
Custom IAM policies that allow Amazon SageMaker Studio or Amazon SageMaker Studio Classic to create Amazon SageMaker resources must also grant permissions to add tags to those resources. The permission to add tags to resources is required because Studio and Studio Classic automatically tag any resources they create. If an IAM policy allows Studio and Studio Classic to create resources but does not allow tagging, "AccessDenied" errors can occur when trying to create resources. For more information, see [Provide permissions for tagging SageMaker AI resources](security_iam_id-based-policy-examples.md#grant-tagging-permissions).  
[AWS managed policies for Amazon SageMaker AI](security-iam-awsmanpol.md) that give permissions to create SageMaker resources already include permissions to add tags while creating those resources.

**Important**  
As of November 30, 2023, the previous Amazon SageMaker Studio experience is now named Amazon SageMaker Studio Classic. The following section is specific to using the updated Studio experience. For information about using the Studio Classic application, see [Amazon SageMaker Studio Classic](studio.md).

Spaces are used to manage the storage and resource needs of some Amazon SageMaker Studio applications. Each space is composed of multiple resources and can be either private or shared. Each space has a 1:1 relationship with an instance of an application. Every supported application that is created gets its own space. The following applications in Studio run on spaces: 
+  [Code Editor in Amazon SageMaker Studio](code-editor.md)
+  [SageMaker JupyterLab](studio-updated-jl.md) 
+  [Amazon SageMaker Studio Classic](studio.md) 

A space is composed of the following resources: 
+ A storage volume. 
  + For Studio Classic, the space is connected to the shared Amazon Elastic File System (Amazon EFS) volume for the domain. 
  + For other applications, a distinct Amazon Elastic Block Store (Amazon EBS) volume is attached to the space. All applications are given their own Amazon EBS volume. Applications do not have access to the Amazon EBS volume of other applications. For more information about Amazon EBS volumes, see [Amazon Elastic Block Store (Amazon EBS)](https://docs.aws.amazon.com//AWSEC2/latest/UserGuide/AmazonEBS.html). 
+ The application type of the space. 
+ The image that the application is based on.

Spaces can be either private or shared:
+  **Private**: Private spaces are scoped to a single user in a domain. Private spaces cannot be shared with other users. All applications that support spaces also support private spaces. 
+  **Shared**: Shared spaces are accessible by all users in the domain. For more information about shared spaces, see [Collaboration with shared spaces](domain-space.md). 

Spaces can be created in domains that use either AWS IAM Identity Center or AWS Identity and Access Management (IAM) authentication. The following sections give general information about how to access spaces. For specific information about creating and accessing a space, see the documentation for the respective application type of the space that you're creating. 

For information about viewing, stopping, or deleting your applications, instances, or spaces, see [Stop and delete your Studio running applications and spaces](studio-updated-running-stop.md).

**Topics**
+ [

# Launch spaces
](studio-updated-spaces-access.md)
+ [

# Collaboration with shared spaces
](domain-space.md)

# Launch spaces


The following sections give information about accessing spaces in a domain. Spaces can be accessed in one of the following ways:
+ from the Amazon SageMaker AI console
+ from Studio
+ using the AWS CLI

## Accessing spaces from the Amazon SageMaker AI console


**To access spaces from the Amazon SageMaker AI console**

1. Open the Amazon SageMaker AI console at [https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/).

1. Under **Admin configurations**, choose **Domains**.

1. From the list of domains, select the domain that contains the spaces.

1. On the **Domain details** page, select the **Space management** tab. For more information about managing spaces, see [Collaboration with shared spaces](domain-space.md).

1. From the list of spaces for that domain, select the space to launch.

1. Choose **Launch Studio** for the space that you want to launch.

## Accessing spaces from Studio


Follow these steps to access spaces from Studio for a specific application type. 

**To access spaces from Studio**

1. Open Studio by following the steps in [Launch Amazon SageMaker Studio](studio-updated-launch.md). 

1. Select the application type with spaces that you want to access.

## Accessing spaces using the AWS CLI


The following sections show how to access a space from the AWS Command Line Interface (AWS CLI). The procedures are for domains that use AWS Identity and Access Management (IAM) or AWS IAM Identity Center authentication. 

### IAM authentication


The following procedure outlines generally how to access a space using IAM authentication from the AWS CLI. 

1. Create a presigned domain URL specifying the name of the space that you want to access.

   ```
   aws \
       --region region \
       sagemaker \
       create-presigned-domain-url \
       --domain-id domain-id \
       --user-profile-name user-profile-name \
       --space-name space-name
   ```

1. Navigate to the URL. 

### Accessing a space in IAM Identity Center authentication


The following procedure outlines how to access a space using IAM Identity Center authentication from the AWS CLI. 

1. Use the following command to return the URL associated with the space.

   ```
   aws \
       --region region \
       sagemaker \
       describe-space \
       --domain-id domain-id \
       --space-name space-name
   ```

1. Append the respective redirect parameter for the application type to the URL to be federated through IAM Identity Center. For more information about the redirect parameters, see [describe-space](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sagemaker/describe-space.html). 

1. Navigate to the URL to be federated through IAM Identity Center. 

# Collaboration with shared spaces


An Amazon SageMaker Studio Classic shared space consists of a shared JupyterServer application and a shared directory. A JupyterLab shared space consists of a shared JupyterLab application and a shared directory within Amazon SageMaker Studio. All user profiles in a domain have access to all shared spaces in the domain. Amazon SageMaker AI automatically scopes resources in a shared space within the context of the Amazon SageMaker Studio Classic application that you launch in that shared space. Resources in a shared space include notebooks, files, experiments, and models. Use shared spaces to collaborate with other users in real-time using features like automatic tagging, real time co-editing of notebooks, and customization. 

Shared spaces are available in:
+ Amazon SageMaker Studio Classic
+ JupyterLab

A Studio Classic shared space only supports Studio Classic and KernelGateway applications. A shared space only supports the use of a JupyterLab 3 image Amazon Resource Name (ARN). For more information, see [JupyterLab Versioning in Amazon SageMaker Studio Classic](studio-jl.md).

 Amazon SageMaker AI automatically tags all SageMaker AI resources that you create within the scope of a shared space. You can use these tags to monitor costs and plan budgets using tools, such as AWS Budgets. 

A shared space uses the same VPC settings as the domain that it's created in. 

**Note**  
 Shared spaces do not support the use of Amazon SageMaker Data Wrangler or Amazon EMR cross-account clusters. 

 **Automatic tagging** 

 All resources created in a shared space are automatically tagged with a domain ARN tag and shared space ARN tag. The domain ARN tag is based on the domain ID, while the shared space ARN tag is based on the shared space name. 

 You can use these tags to monitor AWS CloudTrail usage. For more information, see [Log Amazon SageMaker API Calls with AWS CloudTrail](https://docs.aws.amazon.com//sagemaker/latest/dg/logging-using-cloudtrail.html). 

 You can also use these tags to monitor costs with AWS Billing and Cost Management. For more information, see [Using AWS cost allocation tags](https://docs.aws.amazon.com//awsaccountbilling/latest/aboutv2/cost-alloc-tags.html). 

 **Real time co-editing of notebooks** 

 A key benefit of a shared space is that it facilitates collaboration between members of the shared space in real time. Users collaborating in a workspace get access to a shared Studio Classic application where they can access, read, and edit their notebooks in real time. Real time collaboration is only supported for JupyterServer applications within a shared space. 

 Users with access to a shared space can simultaneously open, view, edit, and execute Jupyter notebooks in the shared Studio Classic or JupyterLab application in that space. 

The notebook indicates each co-editing user with a different cursor that shows the user profile name. While multiple users can view the same notebook, co-editing is best suited for small groups of two to five users.

To track changes being made by multiple users, we strongly recommended using Studio Classic's built-in Git-based version control.

 **JupyterServer 2** 

To use shared spaces in Studio Classic, Jupyter Server version 2 is required. Certain JupyterLab extensions and packages can forcefully downgrade Jupyter Server to version 1. This prevents the use of shared space. Run the following from the command prompt to change the version number and continue using shared spaces.

```
conda activate studio
pip install jupyter-server==2.0.0rc3
```

 **Customize a shared space** 

To attach a lifecycle configuration or custom image to a shared space, you must use the AWS CLI. For more information about creating and attaching lifecycle configurations, see [Create and Associate a Lifecycle Configuration with Amazon SageMaker Studio Classic](studio-lcc-create.md). For more information about creating and attaching custom images, see [Custom Images in Amazon SageMaker Studio Classic](studio-byoi.md).

# Create a shared space


**Important**  
Custom IAM policies that allow Amazon SageMaker Studio or Amazon SageMaker Studio Classic to create Amazon SageMaker resources must also grant permissions to add tags to those resources. The permission to add tags to resources is required because Studio and Studio Classic automatically tag any resources they create. If an IAM policy allows Studio and Studio Classic to create resources but does not allow tagging, "AccessDenied" errors can occur when trying to create resources. For more information, see [Provide permissions for tagging SageMaker AI resources](security_iam_id-based-policy-examples.md#grant-tagging-permissions).  
[AWS managed policies for Amazon SageMaker AI](security-iam-awsmanpol.md) that give permissions to create SageMaker resources already include permissions to add tags while creating those resources.

 The following topic demonstrates how to create a shared space in an existing Amazon SageMaker AI domain. If you created your domain without support for shared spaces, you must add support for shared spaces to your existing domain before you can create a shared space. 

**Topics**
+ [

## Add shared space support to an existing domain
](#domain-space-add)
+ [

## Create a shared space
](#domain-space-create-app)

## Add shared space support to an existing domain


 You can use the SageMaker AI console or the AWS CLI to add support for shared spaces to an existing domain. If the domain is using `VPC only` network access, then you can only add shared space support using the AWS CLI.

### Console


 Complete the following procedure to add support for Studio Classic shared spaces to an existing domain from the SageMaker AI console. 

1. Open the Amazon SageMaker AI console at [https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/).

1. On the left navigation pane, choose **Admin configurations**.

1. Under **Admin configurations**, choose **domains**. 

1.  From the list of domains, select the domain that you want to open the **domain settings** page for. 

1.  On the **domain details** page, choose the **domain settings** tab. 

1.  Choose **Edit**. 

1.  For **Space default execution role**, set an IAM role that is used by default for all shared spaces created in the domain. 

1.  Choose **Next**. 

1.  Choose **Next**. 

1.  Choose **Next**. 

1.  Choose **Submit**. 

### AWS CLI


------
#### [ Studio Classic ]

Run the following command from the terminal of your local machine to add default shared space settings to a domain from the AWS CLI. If you are adding default shared space settings to a domain within an Amazon VPC, you must also include a list of security groups. Studio Classic shared spaces only support the use of JupyterLab 3 image ARNs. For more information, see [JupyterLab Versioning in Amazon SageMaker Studio Classic](studio-jl.md).

```
# Public Internet domain
aws --region region \
sagemaker update-domain \
--domain-id domain-id \
--default-space-settings "ExecutionRole=execution-role-arn,JupyterServerAppSettings={DefaultResourceSpec={InstanceType=example-instance-type,SageMakerImageArn=sagemaker-image-arn}}"

# VPCOnly domain
aws --region region \
sagemaker update-domain \
--domain-id domain-id \
--default-space-settings "ExecutionRole=execution-role-arn,JupyterServerAppSettings={DefaultResourceSpec={InstanceType=system,SageMakerImageArn=sagemaker-image-arn}},SecurityGroups=[security-groups]"
```

Use the following command to verify that the default shared space settings have been updated. 

```
aws --region region \
sagemaker describe-domain \
--domain-id domain-id
```

------
#### [ JupyterLab ]

Run the following command from the terminal of your local machine to add default shared space settings to a domain from the AWS CLI. If you are adding default shared space settings to a domain within an Amazon VPC, you must also include a list of security groups. Studio Classic shared spaces only support the use of JupyterLab 4 image ARNs. For more information, see [JupyterLab Versioning in Amazon SageMaker Studio Classic](studio-jl.md).

```
# Public Internet domain
aws --region region \
sagemaker update-domain \
--domain-id domain-id \
--default-space-settings "ExecutionRole=execution-role-arn", JupyterLabAppSettings={DefaultResourceSpec={InstanceType=example-instance-type,SageMakerImageArn=sagemaker-image-arn}}"

# VPCOnly domain
aws --region region \
sagemaker update-domain \
--domain-id domain-id \
--default-space-settings "ExecutionRole=execution-role-arn, SecurityGroups=[security-groups]"
```

Use the following command to verify that the default shared space settings have been updated. 

```
aws --region region \
sagemaker describe-domain \
--domain-id domain-id
```

------

## Create a shared space


The following sections demonstrate how to create a shared space from the Amazon SageMaker AI console, Amazon SageMaker Studio, or the AWS CLI.

### Create from Studio


Use the following procedures to create a shared space in a domain from Studio.

------
#### [ Studio Classic ]

1. Navigate to Studio following the steps in [Launch Amazon SageMaker Studio](studio-updated-launch.md).

1. From the Studio UI, find the applications pane on the left side.

1. From the applications pane, select **Studio Classic**.

1. Choose **Create Studio Classic space**

1. In the pop up window, enter a name for the space.

1. Choose **Create space**.

------
#### [ JupyterLab ]

1. Navigate to Studio following the steps in [Launch Amazon SageMaker Studio](studio-updated-launch.md).

1. From the Studio UI, find the applications pane on the left side.

1. From the applications pane, select **JupyterLab**.

1. Choose **Create JupyterLab space**

1. In the pop up window, enter a name for the space.

1. Choose **Create space**.

------

### Create from the console


 Complete the following procedure to create a shared space in a domain from the SageMaker AI console. 

1. Open the Amazon SageMaker AI console at [https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/).

1. On the left navigation pane, choose **Admin configurations**.

1. Under **Admin configurations**, choose **domains**. 

1.  From the list of domains, select the domain that you want to create a shared space for. 

1.  On the **domain details** page, choose the **Space management** tab. 

1.  Choose **Create**. 

1.  Enter a name for your shared space. shared space names within a domain must be unique. The execution role for the shared space is set to the domain IAM execution role. 

### Create from AWS CLI


This section shows how to create a shared space from the AWS CLI. 

You cannot set the execution role of a shared space when creating or updating it. The `DefaultDomainExecRole` can only be set when creating or updating the domain. shared spaces only support the use of JupyterLab 3 image ARNs. For more information, see [JupyterLab Versioning in Amazon SageMaker Studio Classic](studio-jl.md).

To create a shared space from the AWS CLI, run one of the following commands from the terminal of your local machine.

------
#### [ Studio Classic ]

```
aws --region region \
sagemaker create-space \
--domain-id domain-id \
--space-name space-name \
--space-settings '{
  "JupyterServerAppSettings": {
    "DefaultResourceSpec": {
      "SageMakerImageArn": "sagemaker-image-arn",
      "InstanceType": "system"
    }
  }
}'
```

------
#### [ JupyterLab ]

```
aws --region region \
sagemaker create-space \
--domain-id domain-id \
--space-name space-name \
--ownership-settings "{\"OwnerUserProfileName\": \"user-profile-name\"}" \
--space-sharing-settings "{\"SharingType\": \"Shared\"}" \
--space-settings "{\"AppType\": \"JupyterLab\"}"
```

------

# Get information about shared spaces


**Important**  
As of November 30, 2023, the previous Amazon SageMaker Studio experience is now named Amazon SageMaker Studio Classic. The following section is specific to using the Studio Classic application. For information about using the updated Studio experience, see [Amazon SageMaker Studio](studio-updated.md).  
Studio Classic is still maintained for existing workloads but is no longer available for onboarding. You can only stop or delete existing Studio Classic applications and cannot create new ones. We recommend that you [migrate your workload to the new Studio experience](studio-updated-migrate.md).

 This guide shows how to access a list of shared spaces in an Amazon SageMaker AI domain with the Amazon SageMaker AI console, Amazon SageMaker Studio, or the AWS CLI. It also shows how to view details of a shared space from the AWS CLI. 

**Topics**
+ [

## List shared spaces
](#domain-space-list-spaces)
+ [

## View shared space details
](#domain-space-describe)

## List shared spaces


 The following topic describes how to view a list of shared spaces within a domain from the SageMaker AI console or the AWS CLI. 

### List shared spaces from Studio


 Complete the following procedure to view a list of the shared spaces in a domain from Studio.

1. Navigate to Studio following the steps in [Launch Amazon SageMaker Studio](studio-updated-launch.md).

1. From the Studio UI, find the applications pane on the left side.

1. From the applications pane, select **Studio Classic** or **JupyterLab**. You can view the spaces that are being used to run the application type.

### List shared spaces from the console


 Complete the following procedure to view a list of the shared spaces in a domain from the SageMaker AI console. 

1. Open the Amazon SageMaker AI console at [https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/).

1. On the left navigation pane, choose **Admin configurations**.

1. Under **Admin configurations**, choose **domains**. 

1.  From the list of domains, select the domain that you want to view the list of shared spaces for. 

1.  On the **domain details** page, choose the **Space management** tab. 

### List shared spaces from the AWS CLI


 To list the shared spaces in a domain from the AWS CLI, run the following command from the terminal of your local machine.

```
aws --region region \
sagemaker list-spaces \
--domain-id domain-id
```

## View shared space details


 The following section describes how to view shared space details from the SageMaker AI console, Studio, or the AWS CLI. 

### View shared spaces details from Studio


 Complete the following procedure to view the details of a shared spaces in a domain from Studio.

1. Navigate to Studio following the steps in [Launch Amazon SageMaker Studio](studio-updated-launch.md).

1. From the Studio UI, find the applications pane on the left side.

1. From the applications pane, select **Studio Classic** or **JupyterLab**. You can view the spaces that are running the application.

1. Select the name of the space that you want to view more details for.

### View shared space details from the console


 You can view the details of a shared space from the SageMaker AI console using the following procedure. 

1. Open the Amazon SageMaker AI console at [https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/).

1. On the left navigation pane, choose **Admin configurations**.

1. Under **Admin configurations**, choose **domains**. 

1.  From the list of domains, select the domain that you want to view the list of shared spaces for. 

1.  On the **domain details** page, choose the **Space management** tab. 

1.  Select the name of the space to open a new page that lists details about the shared space. 

### View shared space details from the AWS CLI


To view the details of a shared space from the AWS CLI, run the following command from the terminal of your local machine.

```
aws --region region \
sagemaker describe-space \
--domain-id domain-id \
--space-name space-name
```

# Edit a shared space


 You can only edit the details for an Amazon SageMaker Studio Classic or JupyterLab shared space using the AWS CLI. You can't edit the details of a shared space from the Amazon SageMaker AI console. You can only update workspace attributes when there are no running applications in the shared space. 

------
#### [ Studio Classic ]

To edit the details of a Studio Classic shared space from the AWS CLI, run the following one of the following commands from the terminal of your local machine. shared spaces only support the use of JupyterLab 3 image ARNs. For more information, see [JupyterLab Versioning in Amazon SageMaker Studio Classic](studio-jl.md).

```
aws --region region \
sagemaker update-space \
--domain-id domain-id \
--space-name space-name \
--query SpaceArn --output text \
--space-settings '{
  "JupyterServerAppSettings": {
    "DefaultResourceSpec": {
      "SageMakerImageArn": "sagemaker-image-arn",
      "InstanceType": "system"
    }
  }
}'
```

------
#### [ JupyterLab ]

To edit the details of a JupyterLab shared space from the AWS CLI, run the following one of the following commands from the terminal of your local machine. shared spaces only support the use of JupyterLab 4 image ARNs. For more information, see [SageMaker JupyterLab](studio-updated-jl.md).

```
aws --region region \
sagemaker update-space \
--domain-id domain-id \
--space-name space-name \
--space-settings "{
      "SpaceStorageSettings": {
      "EbsStorageSettings": { 
      "EbsVolumeSizeInGb":100
    }
    }
  }
}"
```

------

# Delete a shared space


**Important**  
As of November 30, 2023, the previous Amazon SageMaker Studio experience is now named Amazon SageMaker Studio Classic. The following section is specific to using the Studio Classic application. For information about using the updated Studio experience, see [Amazon SageMaker Studio](studio-updated.md).  
Studio Classic is still maintained for existing workloads but is no longer available for onboarding. You can only stop or delete existing Studio Classic applications and cannot create new ones. We recommend that you [migrate your workload to the new Studio experience](studio-updated-migrate.md).

 The following topic shows how to delete an Amazon SageMaker Studio Classic shared space from the Amazon SageMaker AI console or AWS CLI. A shared space can only be deleted if it has no running applications. 

**Topics**
+ [

## Console
](#domain-space-delete-console)
+ [

## AWS CLI
](#domain-space-delete-cli)

## Console


 Complete the following procedure to delete a shared space in the Amazon SageMaker AI domain from the SageMaker AI console. 

1. Open the Amazon SageMaker AI console at [https://console.aws.amazon.com/sagemaker/](https://console.aws.amazon.com/sagemaker/).

1. On the left navigation pane, choose **Admin configurations**.

1. Under **Admin configurations**, choose **domains**. 

1.  From the list of domains, select the domain that you want to create a shared space for. 

1.  On the **domain details** page, choose the **Space management** tab. 

1.  Select the shared space that you want to delete. The shared space must not contain any non-failed apps. 

1.  Choose **Delete**. This opens a new window. 

1.  Choose **Yes, delete space**. 

1.  Enter *delete* in the field. 

1.  Choose **Delete space**. 

## AWS CLI


To delete a shared space from the AWS CLI, run the following command from the terminal of your local machine.

```
aws --region region \
sagemaker delete-space \
--domain-id domain-id \
--space-name space-name
```