

# Hide instance types and images in the Amazon SageMaker Studio UI
<a name="studio-updated-ui-customize-instances-images"></a>

**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).

This topic shows how to hide Amazon SageMaker AI instance types and images displayed in the Amazon SageMaker Studio user interface (UI). For information on the Studio UI, see [Amazon SageMaker Studio UI overview](studio-updated-ui.md).

When you hide SageMaker AI instance types and images: 
+ The impacted users will not be able to view the hidden resources in the Studio UI.
+ The impacted users will not be able to run or create a new space with the hidden configurations. 
+ Any currently running spaces for the impacted users will not be effected. 
+ When an impacted user attempts to run a space with the hidden resources, they will be notified that the relevant resources have been disabled by the administrator.

**Note**  
If, instead of *hiding*, you would like to *restrict* the instance types available to users through an AWS Identity and Access Management policy, see:   
[Can I limit the type of instances that data scientists can launch for training jobs in SageMaker AI?](https://repost.aws/questions/QUd77APmdHTx-2FZCvZfS6Qg/can-i-limit-the-type-of-instances-that-data-scientists-can-launch-for-training-jobs-in-sagemaker) in AWS re:Post.
[Limiting instances types on Amazon SageMaker AI via IAM policy](https://stackoverflow.com/questions/76426316/limiting-instances-types-on-aws-sagemaker-via-iam-policy) in StackOverflow.

The customize Studio UI feature is not available in Amazon SageMaker Studio Classic.

You can customize the Studio UI on a domain level and a user level:
+ Customization on a domain level sets the default for all users in the domain. 
+ Customization on a user level will take priority over the domain level settings.

Use the following topics to learn more on the different customization levels and how to apply them.

**Topics**
+ [Hide instance types and images on a domain level](studio-updated-ui-customize-instances-images-domain.md)
+ [Hide instance types and images on a user level](studio-updated-ui-customize-instances-images-user.md)

# Hide instance types and images on a domain level
<a name="studio-updated-ui-customize-instances-images-domain"></a>

The following shows how to use the console to set rules to hide Amazon SageMaker AI instance types and images from being displayed in the Amazon SageMaker Studio Classic UI on a *domain level*. For more information, see [Hide instance types and images in the Amazon SageMaker Studio UI](studio-updated-ui-customize-instances-images.md).

Once these changes are made on a domain level: 
+ These changes will not effect any currently open spaces.
+ These changes will impact the domain’s users’ *default* visibility from that point onward. 

  These default settings apply for all users in the domain who have *not* had these changes made to their individual user settings.
+ User level settings take priority over the domain level settings.

The customize Studio UI feature is not available in Amazon SageMaker Studio Classic.

## Hide instance types and images on a domain level instructions (console)
<a name="studio-updated-ui-customize-instances-images-domain-instructions-console"></a>

**To hide instance types and images Studio UI on a domain level (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, choose the link to the domain you wish to edit.

1. On the **Domain details** page, choose **Domain settings**.

1. In the **Domain settings** tab, you can view the domain rules in the **Domain rules** section.

1. In the **Domain rules** section choose **Manage rules**.

1. On the **Manage domain rules** page choose a **Rule type**.

   Note that not all instance types and images are available in all AWS Regions.

   1. If you choose **Instance type**, you can use the **Hide** action to hide SageMaker AI instance types you choose in the dropdown list under **Instance types**.

   1. If you choose **Image**, you can use the **Hide** action to hide SageMaker images you choose under the dropdown list under **Image**.

1. (Optional) Choose **\$1 Add new rule** to add more rules.

1. Once you have reviewed your changes, choose **Submit**.

Once completed, you will see a green banner containing a success message at the top of the page.

## Hide instance types and images on a domain level instructions (AWS CLI)
<a name="studio-updated-ui-customize-instances-images-domain-instructions-cli"></a>

**Note**  
To use this feature you may need to update to the latest AWS CLI version. For more information, see [Installing or updating to the latest version of the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).

You can use the AWS CLI to customize the SageMaker AI instances and images displayed in the Studio UI on a domain level, using [StudioWebPortalSettings](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StudioWebPortalSettings.html). Use `HiddenInstanceTypes` to hide instance types and use `HiddenSageMakerImageVersionAliases` to hide SageMaker images. 

Note that when you use `HiddenSageMakerImageVersionAliases`:
+ The API only accepts minor `VersionAliases` (for example, `1.9`), rather than patch versions (For example, `1.9.1`).
+ You may enter unpublished versions through the CLI or SDK. However, these versions will not be displayed in the console and will be overwritten after the rules are edited through the console.

In the following example, for Code Editor, based on Code-OSS, Visual Studio Code - Open Source and JupyterLab, the following are being hidden for users by default in the domain `domainId`:
+ The instance types `ml.r6id.24xlarge` and `ml.r6id.32xlarge`.
+ The image `sagemaker_distribution` versions `1.9` and `1.8`.

```
aws sagemaker update-domain \
    --domain-id domainId \
    --default-user-settings '{
        "StudioWebPortalSettings": {
            "HiddenInstanceTypes": [ "ml.r6id.24xlarge", "ml.r6id.32xlarge" ],
            "HiddenSageMakerImageVersionAliases": [
                {
                    "SageMakerImageName": "sagemaker_distribution",
                    "VersionAliases": [ "1.9", "1.8" ]
                }
            ]
        }
    }'
```

Note that not all instance types and images are available in all AWS Regions.

# Hide instance types and images on a user level
<a name="studio-updated-ui-customize-instances-images-user"></a>

**Warning**  
Customizing a user profile is a permanent action. If custom settings are saved, this user profile will overwrite the domain settings, and no longer dynamically update with the domain in the future.

The following shows how to use the console to set rules to hide Amazon SageMaker AI instance types and images from being displayed in the Amazon SageMaker Studio Classic UI on a *user level*. For more information, see [Hide instance types and images in the Amazon SageMaker Studio UI](studio-updated-ui-customize-instances-images.md).

This setting will take priority over the domain level settings.

The customize Studio UI feature is not available in Studio Classic.

## Hide instance types and images on a user level instructions (console)
<a name="studio-updated-ui-customize-instances-images-user-instructions-console"></a>

**To hide instance types and images Studio UI on a user level (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, choose the link to the domain you wish to edit.

1. On the **Domain details** page, choose the **User profiles** tab.

1. In the **User profiles** section, choose the link to the user profile you wish to edit.

1. On the User details tab, you can view the rules applied to the user in the User profile rules section.

1. In the User profile rules section choose Manage rules.

1. On the Manage user profile rules page choose a Rule type.

   Note that not all instance types and images are available in all AWS Regions.

   1. If you choose **Instance type**, you can use the **Hide** action to hide SageMaker AI instance types you choose in the dropdown list under **Instance types**.

   1. If you choose **Image**, you can use the **Hide** action to hide SageMaker images you choose under the dropdown list under **Image**.

1. (Optional) Choose **\$1 Add new rule** to add more rules.

1. Once you have reviewed your changes, choose **Submit**.

Once completed, you will see a green banner containing a success message at the top of the page.

## Hide instance types and images on a user level instructions (AWS CLI)
<a name="studio-updated-ui-customize-instances-images-user-instructions-cli"></a>

**Note**  
To use this feature you may need to update to the latest AWS CLI version. For more information, see [Installing or updating to the latest version of the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).

You can use the AWS CLI to customize the applications and ML tools displayed in Studio on a user level, using [StudioWebPortalSettings](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_StudioWebPortalSettings.html). Use `HiddenInstanceTypes` to hide instance types and use `HiddenSageMakerImageVersionAliases` to hide SageMaker images. 

Note that when you use `HiddenSageMakerImageVersionAliases`:
+ The API only accepts minor `VersionAliases` (for example, `1.9`), rather than patch versions (For example, `1.9.1`).
+ You may enter unpublished versions through the CLI or SDK. However, these versions will not be displayed in the console and will be overwritten after the rules are edited through the console.

In the following example, for Code Editor, based on Code-OSS, Visual Studio Code - Open Source and JupyterLab, the following are being hidden for user `userProfileName` in the domain `domainId`:
+ The instance types `ml.r6id.24xlarge` and `ml.r6id.32xlarge`.
+ The image `sagemaker_distribution` versions `1.9` and `1.8`.

```
aws sagemaker update-user-profile \
    --domain-id domainId \
    --user-profile-name userProfileName \
    --user-settings '{
        "StudioWebPortalSettings": {
            "HiddenInstanceTypes": [ "ml.r6id.24xlarge", "ml.r6id.32xlarge" ],
            "HiddenSageMakerImageVersionAliases": [
                {
                    "SageMakerImageName": "sagemaker_distribution",
                    "VersionAliases": [ "1.9", "1.8" ]
                }
            ]
        }
    }'
```

Note that not all instance types and images are available in all AWS Regions.