Click the Launch Stack button to deploy a standalone MATLAB® desktop client on AWS®. This opens the CloudFormation Create Stack screen in your web browser.
Note: Creating a stack on AWS can take a few minutes.
After you click the Launch Stack button above, the “Create stack” page will open in your browser where you can configure the parameters. It is easier to complete the steps if you position these instructions and the AWS console window side by side.
-
Specify a stack name. This will be shown in the AWS CloudFormation console and must be unique within the AWS account.
-
Specify and check the defaults for these resource parameters:
Parameter label | Description |
---|---|
AWS EC2 Instance type | AWS instance type to use for MATLAB. See https://aws.amazon.com/ec2/instance-types for a list of instance types. |
Instance Name | Name for the MATLAB virtual machine |
Remote access protocol | Access protocol to connect to this instance |
Enable browser access for MATLAB | Option that enables access to MATLAB on your cloud instance within a browser. Opening MATLAB in a browser opens a separate MATLAB session to your Remote Desktop Protocol (RDP) session or NICE DCV session. |
Keep public ip the same | Flag indicating whether you want to keep the same public IP address for the instance |
Storage Size (GiB) | Size in GB of the root volume |
Custom IAM Role (Optional) | Name of a custom IAM Role to associate with this instance. If not specified, a predefined role is used. If specified, features requiring special permissions will be unavailable (NICE DCV, CloudWatch, IAM Policies). |
Additional IAM Policies (Optional) | Semicolon-delimited list of IAM Policy ARNs to add to the predefined role. This option cannot be used with a custom IAM Role. |
VPC to deploy this stack to | ID of an existing VPC in which to deploy this stack |
Subnet | ID of an existing subnet. To access the instance from anywhere, ensure that your subnet auto-assigns public IP addresses and is connected to the internet. |
SSH Key Pair | Name of an existing EC2 KeyPair to allow SSH access to all the instances. See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html for details on creating these. |
Allow connections from | IP address range that will be allowed to connect to this instance from outside of the VPC. This field should be formatted as <ip_address>/<mask>. E.g. 10.0.0.1/32. This is the public IP address which can be found by searching for 'what is my ip address' on the web. The mask determines the number of IP addresses to include. A mask of 32 is a single IP address. This calculator can be used to build a specific range: https://www.ipaddressguide.com/cidr. You may need to contact your IT administrator to determine which address is appropriate. |
Remote password | Password for the "ubuntu" user. You also need to enter this as an authentication token to access MATLAB on your cloud instance within a browser. |
Confirm remote password | Confirm Password |
License Manager for MATLAB connection string | Optional License Manager for MATLAB, specified as a string in the form <port>@<hostname>. If not specified, use online licensing. If specified, the network license manager (NLM) must be accessible from the specified VPC and subnets. To use the private hostname of the NLM hub instead of the public hostname, specify the security group ID of the NLM hub in the AdditionalSecurityGroup parameter. For more information, see https://github.com/mathworks-ref-arch/license-manager-for-matlab-on-aws. |
Configure cloudwatch logging for the MATLAB instance | Flag indicating whether cloudwatch logging for the MATLAB instance is enabled. |
AutoShutdown | Choose whether you want to enable autoshutdown for your instance after a certain number of hours |
Additional security group to place instances in | ID of an additional (optional) Security Group for the instances to be placed in. Often the License Manager for MATLAB's Security Group. |
Custom AMI ID (Optional) | ID of a custom Amazon Machine Image (AMI) in the target region (optional). If the build has been customized then the resulting machine image may no longer be compatible with the provided CloudFormation template. Compatability can in some cases be restored by making corresponding modifications to the CloudFormation template. The ID should start with 'ami-'. |
Optional user inline command | Provide an optional inline shell command to run on machine launch. For example, to set an environment variable CLOUD=AWS, use this command excluding the angle brackets: <echo -e "export CLOUD=AWS" | tee -a /etc/profile.d/setenvvar.sh && source /etc/profile>. To run an external script, use this command excluding the angle brackets: <wget -O /tmp/my-script.sh "https://www.example.com/script.sh" && bash /tmp/my-script.sh>. Find the logs at '/var/log/mathworks/startup.log'. |
Note: In the capabilities section, you must acknowledge that AWS Cloudformation might create IAM resources and autoexpand nested templates when creating the stack.
- Click the Create Stack button. The CloudFormation service will start creating the resources for the stack.
After clicking Create you will be taken to the Stack Detail page for your stack. Wait for the Status to reach CREATE_COMPLETE. This may take up to 10 minutes.
If you chose RDP, then:
- Expand the Outputs section in the the Stack Detail page.
- Look for the key named
RDPConnection
and copy the corresponding public DNS name listed under value. For example: ec2-11-222-33-44.compute-1.amazonaws.com - Launch any remote desktop client, paste the public DNS name in the appropriate field, and connect. On the Windows Remote Desktop Client you need to paste the public DNS name in the Computer field and click Connect.
- In the login screen that's displayed, use the username
ubuntu
and the password you specified while setting up the stack in Step 2.
If you chose NICE DCV, then:
- Expand the Outputs section in the the Stack Detail page.
- Look for the key named
NiceDCVConnection
and click on it - In the login screen that's displayed, use the username
ubuntu
and the password you specified while setting up the stack in Step 2.
If you chose to enable browser access for MATLAB, then:
- Expand the Outputs section in the Stack Details page.
- Look for the key named
BrowserConnection
and click on it - On the login screen, use the password you specified while deploying the stack in Step 2 as the 'auth token' to authenticate.
- Browser access for MATLAB is enabled using
matlab-proxy
, a MathWorks® developed Python® package. For more information onmatlab-proxy
, refer to matlab-proxy GitHub repository.
Double-click the MATLAB icon on the virtual machine desktop to start MATLAB. The first time you start MATLAB, you need to enter your MathWorks Account credentials to license MATLAB. For other ways to license MATLAB, see MATLAB Licensing in the Cloud.
Note: It may take up to a minute for MATLAB to start the first time.
Once you have finished using your stack, it is recommended that you delete all resources to avoid incurring further cost. To delete the stack, do the following:
- Log in to the AWS Console.
- Go to the AWS CloudFormation page and select the stack you created.
- Click the Actions button and click Delete Stack from the menu that appears.
This CloudFormation template uses nested stacks to reference templates used by multiple reference architectures. For details, see the MathWorks Infrastructure as Code Building Blocks repository.
CloudWatch logs enables you to access logs from all the resources in your stack in a single place. To use CloudWatch logs, launch the stack with the feature "Configure cloudwatch logging for the MATLAB instance" enabled. Once the stack deployment is complete, you can access your logs in the "Outputs" of the stack by clicking the link next to "CloudWatchLogs". Note that if you delete the stack, the CloudWatch log group is also deleted. For more information, see What is Amazon CloudWatch Logs?.
Copyright 2018-2024 The MathWorks, Inc.