Setting up RStudio ALB workspace
Overview
You can access the RStudio workspace type by using the template and AMI provided in AWS partner’s repository. The following table summarizes the sequence of steps that you need to follow to complete the installation for RStudio ALB workspace in the Service Workbench environment.
Task | Description |
---|---|
Creating main account and hosting account | Provides information on how to set up the environment used for RStudio workspace types. In these accounts, you will set up hosted zones, configure the certificates required for deploying RStudio ALB workspace. |
Creating a public hosted zone in the main account | Provides routing information about how you want to route traffic for a domain/subdomain. |
Creating a new name server record in the shared domain | Provides a name to the hosted zone. Here, you will copy the values (containing routing information) that you created in the main account. |
Requesting a public certificate in main account for the hosted zone | Request a public certificate in the main account for the hosted zone. The region is chosen as us-east-1 . Using this option, you request a public certificate from Amazon. By default, these public certificates are trusted by browsers and operating systems. |
Creating a staging file using the latest Service Workbench code | Download the latest Service Workbench code and set up the staging file for deploying RStudio ALB workspace. For more information about staging file, see Configuration settings. |
Creating AMIs | Provides the basis of RStudio environment that researchers use for research. Refer to the AWS partner’s README for more information. |
Installing EC2 RStudio Server | Deploys RStudio into Service Workbench’s portfolio. Refer to the AWS partner’s README for more information. |
Requesting a new public certificate within member account for hosted zone domain | Provides steps on how to request a public certificate for member (hosting) account using ACM. The certificate contains the ARN value that is used to import the products. |
Creating a new record in the main account hosted zone | Validates the member account public certificate. Without the validation, no workspaces can be created. |
Accessing RStudio Workspace in Service Workbench | Configure RStudio ALB using Service Workbench. |
Creating main account and hosting account
Task: You will learn to create a main account and a hosting account and assign Admin role to these accounts.
- Choose Create/Register Account.
- On the Account Creation page, choose Create.
- On the Create AWS Accounts page, specify the account email address, account name, secondary owner, financial owner, ownership group, description, and account type.
- Choose Submit.
- Choose Manage Account.
- Create a console role:
a. Choose Add.
b. For One Click Roles, choose Admin.
Note: Follow the same steps above to create a hosting account and choose the admin role. In the description, specify that it is a hosting account.
Creating a public hosted zone in the main account
Task: You will learn to create a public hosted zone for the main account and add routing information to it.
- Sign in to the AWS Management Console.
- Under AWS Services, choose Route 53.
- On the Route 53 dashboard, choose Hosted zones.
- Choose Create hosted zone.
- On the Create hosted zone page:
a. For Domain name, enter the domain name.
b. For Description – optional, enter the description.
c. For Type, choose Public hosted zone. - Choose Create hosted zone.
- Copy the values from the Value/Route traffic to field for later use.
Creating a new name server record in the shared domain
Task: You will learn to create a new record name for the public hosted zone.
- Sign in to the AWS Management Console.
- Under AWS Services, choose Route 53.
- On the Route 53 dashboard, choose Hosted zones.
- Choose the hosted zone that you just created.
- Choose Create record.
- On the Quick create record page, choose Add another record.
- For Record name, enter the name.
- For Record type, choose NS – Name servers for a hosted zone.
- For Value, enter the values that you copied from the Value/Route traffic to field earlier.
- For TTL (seconds), enter the value.
- For Routing policy, choose Simple routing.
- Choose Create records.
Requesting a public certificate in main account for the hosted zone
Task: You will learn how to request a certificate for the main account in AWS Certificate Manager (ACM) and access the CNAME record details from that certificate.
Requesting a certificate in AWS Certificate Manager
- Sign in to the AWS Management Console.
- Go to AWS Certificate Manager.
Note: To use an ACM certificate with Amazon CloudFront, you must request or import the certificate in the US East (N. Virginia) region. - Choose Request a certificate.
- On the Request certificate page, choose Request a public certificate.
- Choose Next.
- On the Request a public certificate page:
a. For Domain names, enter the domain name.
b. For Select validation method, choose DNS validation – recommended. - Choose Request.
- Refresh your screen to view the newly created certificate.
- Choose the certificate to view the details.
- Under Domains, copy the values for CNAME name and CNAME value.
Creating a new record in the main account
- Go the main account.
- Choose the hosted zone created earlier. See Creating a public hosted zone in the main account.
- Create a new record.
- For Record name, paste the first part of the CNAME record created in the previous section.
- For Value, paste the CNAME value copied in the previous section.
- Choose Create records.
Creating a staging file using the latest Service Workbench code
Task: You will learn how to create and configure the staging file for setting up the RStudio ALB workspace.
- Go to the
/main/config/settings
directory. - Create a new staging file. Example:
cp example.yml albr.yml
- In the newly created stage file, remove comments and keep awsRegion as us-east-1. You can change the value of awsProfile , for example, rstudio. Update the configuration (config file) and credentials (credentials file) within the
.aws
folder so that the new account details are included. The updated config file should have the following values:region
(default isus-east-1
), output (yaml
),account_id
, androle_name
. To update credentials, you need to create a CLI user. For more information on creating a user, see IAM users. - For
solutionName
, entersw
. - For
envName
, enter the stage name, for example,albr
. - For
envType
, enter a name, for example,dev
. - For
createServiceCatalogPortfolio
, enter the value astrue
. - For
rootUserEmail
, enter the email address. - For
domainName
, enter the domain name of the main account hosted zone. - For
certificateArn
, copy the certificate ARN of the main account and paste it. - From
defaults.yml
file, copy the hostedZoneId into the newly created staging file (for example,albr.yml
). - Copy the Hosted zone ID details Hosted zone page in Route 53 and paste it in
hostedZoneId
in your staging file.
Your new stage file is now ready for deployment.
Creating AMIs
Follow the instructions in the README to install EC2 RStudio server AMIs. You can go to your main account and access these AMIs under Images.
Note: Edit the configuration file (RStudio/machine-images/config/infra/configuration.json
). You need to update the region (to match your deployment config file), amiName
(suggested: rstudio-alb
), and awsProfile
(to match your deployment config file). Update stageName
to match your deployment configuration file.
Installing EC2 RStudio Server
Follow the instructions in the README to install EC2 RStudio server.
Requesting a new public certificate within member account for hosted zone domain
Task: You will learn to request a public certificate for member (hosting) account using ACM and copy the ARN value.
- Sign in to the AWS Management Console.
- Choose Certificate Manager.
- On the AWS Certificate Manager page, choose
Request a certificate
. - Choose
Next
. - For
Certificate type
, chooseRequest a public certificate
. - Choose
Next
. - On the
Request a public certificate
page:
a. ForDomain names
, enter the domain name in the following two ways:example.corp.com
and*.example.corp.com
. Here,example.corp.com
is the full domain name.
b. For Select validation method, choose DNS validation – recommended. - Choose Request.
- On the Certificate page, within Certificate status, copy the ARN. The ARN will be used to import the products.
Creating a new record in the main account hosted zone
Task: This task validates the member account public certificate.
- Go to the hosting account certificate manager.
- On the certificate page, copy values for
CNAME name
andCNAME value
. - Switch over to the main account.
- On the AWS Management Console, choose Route 53.
- Choose Hosted zones.
- Choose the domain name.
- Choose Create new record.
- For Record name, paste the first part of the CNAME record created in the previous section.
- For Record type, choose CNAME – Routes traffic to another domain.
- For Value, paste the CNAME value copied in the previous section.
- Choose Create records.
Accessing RStudio Workspace in Service Workbench
Task: You will log in to Service Workbench, create a user and configure the account for using RStudio ALN workspace.
- Sign in to Service Workbench first time as the root user.
- Add a local user.
- For Accounts, AWS Accounts, Add AWS Account, add the member account.
- For Accounts, Indexes, Add Index associated with member account, create an index.
- For Accounts, Projects, Add Project associated with that index, create a new project.
- For Users, Users, Detail, Edit, associate the user with the new project.
- Import EC2 RStudio Server and add new configuration for the workspace type.
ACMSSLCertArn
is asking for the member account certificate ARN. - Enter the instance type for the EC2 instance.
AmiId
is the AMI ID of the newly created AMI in the main account. - Approve the configuration.
- Create a new workspace in by selecting the RStudio Server workspace type and configuration.
- Connect to the RStudio Workspace. Make sure popups are enabled.