Delete a Studio Domain
Upon onboarding to SageMaker Studio through IAM authentication, the Studio will create a domain associated with your account. This domain is made up of a list of configuration settings, an Elastic File System (EFS) volume and authorized users. The EFS volume includes the users’ data, such as resources, keep in notebooks and artifacts. Users may possess various apps that support the execution experience and the reading of their consoles, terminals and keep in notebooks.
If you’d like to return Studio to its previous state prior to onboarding, you are required to delete this domain. Keep in mind that the EFS volume will not get deleted when you delete the domain.
You will have to delete the domain in case you’d like to switch your authentication modes from IAM to SSO.
If you want to delete a studio domain, make sure it does not contain user profiles. If you want to delete a user profile, make sure it does not contain non-failed applications.
Upon deleting these resources, the below will occur:
- App: Data such as notebooks and files that are found in a user’s home directory is going to be saved. Keep in notebook data which is not saved, is going to be lost.
- User profile: User now can’t sign in to Studio and can’t access to their home directory, yet the data is not going to be deleted. Data can be retrieved by an admin from the EFS volume where it is stored for the account of this user.
Keep in mind
Admin permission is needed for your ability to delete a studio domain.
Only an app having a status of “InService” may be deleted, and it should be shown as Ready in Studio. An app having a Failed status will not require to get deleted so that the containing domain is deleted. Using Studio, if you try to delete an app having a failed state you will receive an error.
How can you delete a Studio Domain using the Studio?
In order for you to delete a studio domain, go over the below steps:
- Go straight to the SageMaker console.
- Click on Amazon SageMaker Studio located on the top left, so that you are sent to the Amazon SageMaker Studio Control Panel.
- Go over the below steps once again for every user found in the User name list.
- Select the needed user.
- From the page named User Details, for every non-failed app from the Apps list, click on Delete app.
- From the dialog of Delete app, click on Yes, delete app, enter “delete” inside the confirmation field, then click Delete.
- As soon as every app’s Status is shown as Deleted, click on Delete user.
Keep in mind
Upon deleting a user, this user will no longer have access to the EFS volume containing the data of the user, among which are “keep in notebooks” and different artifacts.
4. As soon as every user gets deleted, click on Delete Studio.
5. From the dialog of Delete Studio, click on Yes, delete Studio, enter “delete” in the confirmation field, then click on Delete.
How can you delete a SageMaker Studio Domain using the CLI?
In order for you to delete a studio domain, go over the below steps:
- Get a list of the domains found in your account.
aws –region Region sagemaker list-domains
- Get a list of the apps for the domain which is going to get deleted.
aws –region Region sagemaker list-apps \
–domain-id-equals DomainId
- Start deleting every app found in the list.
aws –region Region sagemaker delete-app \
–domain-id DomainId \
–app-name AppName \
–app-enter AppEnter \
–user-profile-name UserProfileName
- Get a list of the user profiles that are found in the domain.
aws –region Region sagemaker list-user-profiles \
–domain-id-equals DomainId
- Start deleting every single user profile found in the list.
aws –region Region sagemaker delete-user-profile \
–domain-id DomainId \
–user-profile-name UserProfileName
- End by deleting the domain.
aws –region Region sagemaker delete-domain \
–domain-id DomainId
This is how easy it would be for you to delete a studio domain and switch back to your previous SageMaker Studio. Once you delete a domain your authentication mode will be changed from IAM to SSO.