Enable RStudio on SageMaker
These steps provide a quickstart for enabling an Amazon Web Services (AWS) SageMaker domain with RStudio.
RStudio on SageMaker is the implementation of Workbench within a SageMaker domain in which RStudio sessions are made available to SageMaker users.
You may see references to RStudio Workbench or RStudio Server Pro in AWS documentation. These are previous names for Posit Workbench, and will be phased out as product and company rebranding updates are made in AWS documentation.
Requirements
Step 1: Create a SageMaker domain with RStudio
First, configure RStudio on SageMaker as part of the SageMaker domain creation process on the AWS Management Console.
To create your domain on the console, complete the following steps:
- Navigate to the Amazon SageMaker console and then to the SageMaker Domain page.
- From the SageMaker Domain page:
- Select Standard setup.
- Click Configure.
Setup SageMaker Domain - Step 1: General Settings:
For the Authentication method, based on the standard method for your AWS environment, select either:
- AWS SSO
- AWS IAM
For the Permission configuration, choose or create a default IAM execution role for your SageMaker domain.
Select your preferred Network and Storage options.
Click Next.
Additionally, you can add RStudio to an existing domain. The procedures to do this are available in the Add RStudio support to an existing Domain AWS documentation.
Setup SageMaker Domain - Step 2: Studio Settings
- Studio Settings allow you to configure your Studio notebooks.
- These configuration options are outside of the scope of RStudio setup.
- Click Next to continue.
Setup SageMaker Domain - Step 3: RStudio settings
In the RStudio Workbench - optional section, configure the following:
License:
- SageMaker automatically detects a Workbench license after it has been added. The license is available to use after you accept and activate the grant in the AWS License Manager.
Instance type:
- You can choose the instance type for the Workbench server that is shared by all users.
This instance runs the Workbench server but not users’ individual RStudio sessions. Each RStudio user in SageMaker is able to choose a different instance type to run their session on, which is covered in the User profile section below. Please review the RStudio Architecture on SageMaker diagram. If the default instance, t3.medium, is chosen, it does not incur cost in the AWS account.
For more information about Workbench instance types, please see the RStudioServerPro instance type documentation.
In the Permission section, from the RStudio Server execution role drop-down menu, select the IAM Execution role that you created as part of the Requirements.
Optionally, you can configure the default Connect and Package Manager URLs for all user profiles at the domain level. For detailed instructions, see the Configure RStudio on SageMaker to use Posit products documentation.
Once you have input all of your configuration options, click Next.
To create the domain, click Submit.
Step 2. Create a SageMaker domain user profile
Creating a user in a SageMaker domain allows access to both Studio and RStudio on SageMaker.
To enable RStudio for a user via the console, complete the following steps:
Navigate to the Amazon SageMaker console and then to the SageMaker Domain page.
From the SageMaker Domain page, click Add user.
The SageMaker Domain - Add user profile wizard displays.
Add user profile - Step 1: General Settings:
- From the Add user profile page, do the following:
In the Name field, type a username.
From the Default execution role drop-down menu, choose an existing role or create a new one with specific access to Amazon Simple Storage Server (AWS) buckets.
Click Next.
This role is used when the user launches RStudio sessions and defines AWS permissions available to that session, such as what EC2 instance types are available for sessions, and permissions available for accessing S3 buckets. See the SageMaker Roles section of the Amazon SageMaker Developer Guide.
Add user profile - Step 2: Studio Settings
- Studio Settings allow you to configure your Studio notebooks.
- These configuration options are outside of the scope of RStudio setup.
- Click Next to continue.
Setup SageMaker Domain - Step 3: RStudio settings
- From the RStudio Workbench - optional section, configure the following:
- License: Studio automatically detects a Workbench license after it’s been added and accepted by License Manager.
- From the License Authorization drop-down menu, select either:
- RStudio Admin or
- RStudio User or
- Unauthorized Unauthorized users will not have access to RStudio through the SageMaker domain.
- Click Submit.
Additional information
The Get started with RStudio on Amazon SageMaker documentation provides additional information about the Requirements and various ways to complete this setup.