To create a Jupyter Notebook in AWS, we can use a service called Amazon SageMaker. Follow the steps given below to create a Jupyter Notebook using the AWS Command Line Interface (CLI):
Use the create-notebook-instance
command to create a notebook instance in SageMaker:
We can give any name to your Notebook instance, i.e., new-notebook-instance
.
We can give any valid instances as instance type, i.e. ml.t2.medium
, in which we want to set up our notebook.
We must create a role for SageMaker and replace <arn>
in the command given below with the ARN of your role.
aws sagemaker create-notebook-instance --notebook-instance-name new-notebook-instance --instance-type ml.t2.medium --role-arn <arn>
The notebook instance will take some time to start. The status of the instance that you created will change from “Pending” to “InService” once it starts. You can use the describe-notebook-instance
command to check the status of the notebook instance.
aws sagemaker describe-notebook-instance --notebook-instance-name new-notebook-instance
Wait until the status changes to InService
before proceeding. Once the notebook instance is in the InService
status, you can access the Jupyter Notebook through the AWS console by performing the following steps:
Search “SageMaker” on the AWS console and click “Amazon SageMaker” from the search results.
Under the “Notebook” section in the sidebar, click “Notebook instances.”
Under the “Actions” column of the notebook you have created, click “Open Jupyter.” This will redirect you to Jupyter Notebook. You can create a new notebook there and train models.
Run the commands given above using this widget. Enter your AWS access_key_id
and secret_access_key
in the widget below before running any commands. If you don’t have these keys, follow the steps in
Note: The IAM user whose credentials are used must have permissions to perform all the required actions.
Congratulations! You’ve successfully created a Jupyter Notebook instance in AWS SageMaker using the CLI.
Free Resources