Launch a Code Editor application using the AWS CLI
To configure and access your Code Editor integrated development environment through the AWS Command Line Interface (AWS CLI), you must create a Code Editor space. Be sure to meet the Complete prerequisites before going through the following steps. Use the following procedure to create and run a Code Editor space.
To create and run a Code Editor space
Access a space using AWS Identity and Access Management (IAM) or AWS IAM Identity Center authentication. For more information about accessing spaces using the AWS CLI, see Accessing spaces using the AWS Command Line Interface in Amazon SageMaker Studio spaces.
Create an application and specify
CodeEditor
as theapp-type
using the following command.If you use a GPU instance type when creating your Code Editor application, you must also use a GPU-based image.
aws sagemaker create-app \ --domain-id
domain-id
\ --space-namespace-name
\ --app-typeCodeEditor
\ --app-namedefault
\ --resource-spec "SageMakerImageArn=arn:aws:sagemaker:region
:account-id
:image/sagemaker-distribution-cpu
"For more information about available Code Editor image ARNs, see Code Editor application instances and images.
After the Code Editor application is in service, launch the application using a presigned URL. You can use the
describe-app
API to check if your application is in service. Use thecreate-presigned-domain-url
API to create a presigned URL:aws sagemaker create-presigned-domain-url \ --domain-id
domain-id
\ --space-namespace-name
\ --user-profile-nameuser-profile-name
\ --session-expiration-duration-in-seconds43200
\ --landing-uriapp:CodeEditor:
Open the generated URL to start working in your Code Editor application.