Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are the console steps to disable root access for an existing (or new) SageMaker notebook instance.
A. Check current root access setting
- Sign in to the AWS Management Console.
- Open the Amazon SageMaker console.
- In the left menu, choose Notebook instances.
- Find your notebook instance and look at the Root access column:
- It will show Enabled or Disabled.
B. Disable root access for an existing notebook instance
- In the Notebook instances list, select the notebook you want to change.
- Make sure the notebook is Stopped:
- If it is InService, choose Stop and wait until the status becomes Stopped.
- With the notebook instance selected, choose Edit (or Actions ➜ Edit depending on the UI).
- In the edit screen, locate the Root access setting.
- Change Root access to:
- Disabled
- Review any other settings you do not want to change, then scroll down and choose Submit or Save changes.
- After the edit completes, select the notebook instance and choose Start to bring it back InService.
C. Disable root access when creating a new notebook instance
- In the SageMaker console, go to Notebook instances.
- Choose Create notebook instance.
- Configure the required details (name, instance type, IAM role, VPC, etc.).
- Find the Root access setting.
- Set Root access to:
- Disabled
- Complete the rest of the configuration as required and choose Create notebook instance.
Using CLI
Using CLI
To disable root access on a SageMaker Notebook Instance using AWS CLI, you must set the
Wait for the instance to be
(Optional) Wait until it is stopped:Ensure the status is
Expected output:
--root-access parameter to Disabled (either when creating the instance or by updating an existing one).Below are step‑by‑step instructions for both scenarios.1. For a new Notebook Instance
When creating a notebook instance, specify--root-access Disabled:InService (you can check with):2. For an existing Notebook Instance
You must update the configuration and then restart the instance.Step 2.1 – Stop the notebook instance (if running)
Stopped.Step 2.2 – Update to disable root access
Step 2.3 – Start the notebook instance again
3. Verify root access is disabled
Using Python
Using Python
You disable root access on a SageMaker notebook instance by updating its configuration via the SageMaker API (boto3). Below are the minimal steps in Python.
This will create/run the notebook instance with root access disabled from the start.
1. Prerequisites
- AWS credentials/config set (via environment variables, IAM role, or config files).
boto3installed:
2. Disable root access on an existing Notebook Instance
3. Create a new Notebook Instance with root access disabled
Using Terraform
Using Terraform
Stopped state before Terraform can successfully apply the root_access = "Disabled" update; stopping/starting must be done outside Terraform (CLI or console) as Terraform does not expose those actions.This change does not force resource replacement; Terraform will perform an in-place update.On
terraform plan, you should see root_access changing from Enabled (or its current value) to "Disabled" for this aws_sagemaker_notebook_instance resource.
