Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 56 additions & 115 deletions README.md

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions releases/R2021b/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
MATHWORKS CLOUD REFERENCE ARCHITECTURE LICENSE

The files in this GitHub repository refer to commercial software products and services, virtual machine images, and related materials of The MathWorks, Inc. (“MathWorks Programs”). MathWorks Programs are separately licensed under the MathWorks Software License Agreement, available in the desktop installation of the MathWorks Programs or in the virtual machine image. The files in this GitHub repository may also refer to third-party software licensed under separate terms provided by such third parties.

The following license terms apply only to the files in this GitHub repository, including files in this folder and its subfolders, and do not apply to MathWorks Programs. References to “software” and “code” in the following license terms refer to the files in this GitHub repository.

Copyright (c) 2021, The MathWorks, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. In all cases, the software is, and all modifications and derivatives of the software shall be, licensed to you solely for use in conjunction with MathWorks products and service offerings.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
250 changes: 250 additions & 0 deletions releases/R2021b/README.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
311 changes: 311 additions & 0 deletions releases/R2021b/templates/mps-aws-refarch-existing-vpc-cf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,311 @@
AWSTemplateFormatVersion: "2010-09-09"
Description: "R2021b MATLAB Production Server Reference Architecture with Existing VPC"
Parameters:
KeyPairName:
Type: "AWS::EC2::KeyPair::KeyName"
Description: "Enter the key pair name to use for all EC2 instances. If you do not have a key pair, create one in the EC2 console >> Network & Security >> Key Pairs."
ConstraintDescription: "Must be the name of an existing EC2 Key Pair."
ClientIPAddress:
Description: "Allowed IP addresses that can connect to the MATLAB Production Server VM(s) and the dashboard VM. Specify the range in CIDR notation in the format IP Address/Suffix, where Suffix is an integer between 0 and 32. Example: 10.0.0.1/24."
Type: String
MinLength: 9
MaxLength: 18
AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
ConstraintDescription: "Must be a valid IP in CIDR notation of the form x.x.x.x/x"
AllowPublicIP:
Description: "Specify whether the deployed solution should use public IP addresses."
Type: String
AllowedValues:
- 'Yes'
- 'No'
Default: 'Yes'

NumWorkerNodes:
Description: "Each MATLAB Production Server instance runs on a VM. Specify the number of VMs to run server instances."
Type: Number
Default: 2
MinValue: 1
MaxValue: 24

WorkerInstanceType:
Description: "Specify the EC2 instance type to use for a server VM. Each server VM runs multiple MATLAB workers. The default number of workers is 4. Choosing a VM size where the number of vCPUs on a VM matches the number of workers is recommended. For more information on Amazon EC2 instance types and sizes, see https://aws.amazon.com/ec2/instance-types/"
Default: "m5.xlarge"
Type: String
AllowedValues:
- 'm5.xlarge'
- 'm5.2xlarge'
- 'm5.4xlarge'
- 'm5.8xlarge'
- 'm5.12xlarge'
- 'm5.16xlarge'
- 'm5.24xlarge'
- 'm5.metal'
- 'c5.xlarge'
- 'c5.2xlarge'
- 'c5.4xlarge'
- 'c5.9xlarge'
- 'c5.12xlarge'
- 'c5.18xlarge'
- 'c5.24xlarge'
- 'c5.metal'
- 'r5.xlarge'
- 'r5.2xlarge'
- 'r5.4xlarge'
- 'r5.8xlarge'
- 'r5.12xlarge'
- 'r5.16xlarge'
- 'r5.24xlarge'
- 'r5.metal'
ConstraintDescription: "Specify worker instance type."

WorkerSystem:
Description: Choose between Windows (Windows Server) and Linux (Ubuntu).
Type: String
AllowedValues:
- Ubuntu
- Windows

SSLCertificateARN:
Description: "Enter the ARN to use for HTTPS connections to the server and dashboard. The ARN you provide must match an existing certificate in the AWS Certificate Manager."
Type: String
AllowedPattern: "arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]+:[\\w+=,.@-]+(/[\\w+=,.@-]+)*"
ConstraintDescription: "Must be a valid certificate ARN of the form arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012"

EnablePersistence:
Description: "Specify whether you want to deploy ElastiCache for Redis that lets you use the persistence functionality on the server."
Type: String
AllowedValues:
- 'Yes'
- 'No'
Default: 'No'

DeployLicenseServer:
Description: "Specify whether you want to deploy the Network License Manager for MATLAB"
Type: String
AllowedValues:
- 'Yes'
- 'No'
Default: 'Yes'
Username:
Description: "Specify the administrator user name to log in to the MATLAB Production Server dashboard."
Type: String
AllowedPattern: "^[^'\\s]*$"
ConstraintDescription: Must not contain whitespace or single quote
Password:
Description: "Specify the administrator password to log in to the MATLAB Production Server dashboard and MATLAB license server dashboard."
Type: String
AllowedPattern: "^[^'\\s\\$]*$"
ConstraintDescription: Must not contain whitespace, single quote or $ sign
NoEcho: true
ConfirmPassword:
Description: "Reenter the administrator password to log in to the MATLAB Production Server dashboard and MATLAB license server dashboard."
Type: String
NoEcho: true

ExistingVPC:
Description: "ID of your existing VPC where you want to deploy this solution."
Type: "AWS::EC2::VPC::Id"
ConstraintDescription: "Must be the ID of an existing VPC."
Default: ""
ExistingVPCAddress:
Description: "Get the IP address range from the existing VPC you selected above."
Type: String
MinLength: 9
MaxLength: 18
AllowedPattern: "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})"
ConstraintDescription: "Must be a valid IP CIDR range of the form x.x.x.x/x"
ExistingSubnet1:
Description: "ID of an existing subnet that will host the dashboard and cloud resources."
Type: "AWS::EC2::Subnet::Id"
ConstraintDescription: "Must be the ID of an existing Subnet."
Default: ""
ExistingSubnet2:
Description: "ID of an existing subnet that will host the load balancer."
Type: "AWS::EC2::Subnet::Id"
ConstraintDescription: "Must be the ID of an existing Subnet."
Default: ""


Metadata:
"AWS::CloudFormation::Interface":
ParameterGroups:
- Label:
default: Server
Parameters:
- NumWorkerNodes
- WorkerInstanceType
- WorkerSystem
- EnablePersistence
- DeployLicenseServer
- Label:
default: Dashboard Login
Parameters:
- Username
- Password
- ConfirmPassword
- Label:
default: Network
Parameters:
- KeyPairName
- ClientIPAddress
- AllowPublicIP
- SSLCertificateARN
- Label:
default: Existing VPC
Parameters:
- ExistingVPC
- ExistingVPCAddress
- ExistingSubnet1
- ExistingSubnet2

ParameterLabels:
KeyPairName:
default: "Name of Existing Key Pair"
NumWorkerNodes:
default: "Number of Server VMs"
SSLCertificateARN:
default: "ARN of SSL Certificate"
WorkerInstanceType:
default: "Server VM Type"
WorkerSystem:
default: Choose between Windows (Windows Server) and Linux (Ubuntu).
Username:
default: Username for Dashboard
Password:
default: Password for MPS and License Server Dashboard
ConfirmPassword:
default: Confirm Password for MPS and License Server Dashboard
ClientIPAddress:
default: "Allow Connections from IP Address"
AllowPublicIP:
default: "Make Solution Available over Internet"
EnablePersistence:
default: "Create ElastiCache for Redis"
ExistingVPC:
default: "Existing VPC ID"
ExistingVPCAddress:
default: "IP Address Range of Existing VPC"
ExistingSubnet1:
default: "Subnet 1 ID"
ExistingSubnet2:
default: "Subnet 2 ID"

Rules:
matchPasswords:
Assertions:
- Assert: !Equals [!Ref Password, !Ref ConfirmPassword]
AssertDescription: "Passwords do not match"
checkSubnetInVPC:
Assertions:
- Assert: !EachMemberEquals
- !ValueOfAll
- AWS::EC2::Subnet::Id
- VpcId
- !Ref ExistingVPC
AssertDescription: Subnet must exist in the VPC you have selected
noLicenseDeployIfPrivate:
RuleCondition: !Equals
- !Ref AllowPublicIP
- "No"
Assertions:
- Assert: !Equals [!Ref DeployLicenseServer, "No"]
AssertDescription: 'License Server should not be deployed to private subnets'

Conditions:
DoPublicIP: !Equals
- 'Yes'
- !Ref AllowPublicIP
DoDeployLicenseServer: !Equals
- 'Yes'
- !Ref DeployLicenseServer

Mappings:
VarMap:
NestedTemplateURLs:
vpsStackURL: 'https://matlab-production-server-templates.s3.amazonaws.com/r2021b_mps_refarch/mw-aws-payg-vpc-stack-cf.yml'
productionServerStackURL: 'https://matlab-production-server-templates.s3.amazonaws.com/r2021b_mps_refarch/mw-aws-refarch-cf.yml'

Outputs:
MATLABProductionServerAdminVM:
Description: Admin VM that hosts MATLAB Production Server dashboard
Value: !GetAtt MatlabProductionServerResourcesStack.Outputs.MATLABProductionServerAdminVM
MatlabProductionServerLicenseServer:
Description: "Address of the MATLAB network license manager dashboard"
Value: !If
- DoDeployLicenseServer
- !GetAtt MatlabProductionServerLicenseServerStack.Outputs.ServerAddress
- 'License Server was not deployed with this stack'
MATLABProductionServerApplicationsBucket:
Description: "S3 Bucket for MATLAB Production Server applications (CTF files)"
Value: !GetAtt MatlabProductionServerResourcesStack.Outputs.MATLABProductionServerApplicationsBucket
MATLABProductionServerDashboardURL:
Description: URL to access MATLAB Production Server dashboard
Value: !GetAtt MatlabProductionServerResourcesStack.Outputs.MATLABProductionServerDashboardURL
MATLABProductionServerFunctionExecutionURL:
Description: MATLAB Execution Endpoint
Value: !GetAtt MatlabProductionServerResourcesStack.Outputs.MATLABProductionServerFunctionExecutionURL
MATLABProductionServerAdminVMLogGroup:
Description: CloudWatch log group for admin VM
Value: !GetAtt MatlabProductionServerResourcesStack.Outputs.MATLABProductionServerAdminVMLogGroup
MATLABProductionServerWorkerVMLogGroup:
Description: CloudWatch log group for worker VM
Value: !GetAtt MatlabProductionServerResourcesStack.Outputs.MATLABProductionServerWorkerVMLogGroup
MATLABProductionServerAutoScalingGroup:
Description: Auto Scaling Group for managing the number of server VMs
Value: !GetAtt MatlabProductionServerResourcesStack.Outputs.MATLABProductionServerAutoScalingGroup
MATLABProductionServerCloudStackCacheClusterAddress:
Description: Hostname of Redis cache cluster
Value: !GetAtt MatlabProductionServerResourcesStack.Outputs.MATLABProductionServerCloudStackCacheClusterAddress
MATLABProductionServerCloudStackCacheClusterPort:
Description: Port number of Redis cache cluster
Value: !GetAtt MatlabProductionServerResourcesStack.Outputs.MATLABProductionServerCloudStackCacheClusterPort
MATLABProductionServerLoadBalancer:
Description: Load balancer to change SSL certificate for MATLAB execution endpoint
Value: !GetAtt MatlabProductionServerResourcesStack.Outputs.MATLABProductionServerLoadBalancer
MATLABProductionServerDashboardLoadBalancer:
Description: Load balancer to change SSL certificate for MATLAB Production Server dashboard
Value: !GetAtt MatlabProductionServerResourcesStack.Outputs.MATLABProductionServerDashboardLoadBalancer

Resources:
MatlabProductionServerLicenseServerStack:
Condition: DoDeployLicenseServer
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: 'https://network-license-manager-for-matlab-on-aws.s3.amazonaws.com/R2020b/license-manager-template.json'
Parameters:
VPC: !Ref ExistingVPC
Subnet: !Ref ExistingSubnet1
ClientIPAddress: !If [DoPublicIP, !Ref ClientIPAddress, !Ref ExistingVPCAddress]
ServerInstanceType: t2.micro
SSHKeyName: !Ref KeyPairName
Password: !Ref Password
ConfirmPassword: !Ref ConfirmPassword

MatlabProductionServerResourcesStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: !FindInMap [VarMap, NestedTemplateURLs , productionServerStackURL]
Parameters:
ExistingVPC: !Ref ExistingVPC
ExistingVPCAddress: !Ref ExistingVPCAddress
ExistingSubnet1: !Ref ExistingSubnet1
ExistingSubnet2: !Ref ExistingSubnet2
KeyPairName: !Ref KeyPairName
ClientIPAddress: !Ref ClientIPAddress
AllowPublicIP: !Ref AllowPublicIP
SSLCertificateARN: !Ref SSLCertificateARN
NumWorkerNodes: !Ref NumWorkerNodes
WorkerInstanceType: !Ref WorkerInstanceType
WorkerSystem: !Ref WorkerSystem
EnablePersistence: !Ref EnablePersistence
Username: !Ref Username
Password: !Ref Password
ConfirmPassword: !Ref ConfirmPassword
LicenseServerSecurityGroup: !If
- DoDeployLicenseServer
- !GetAtt MatlabProductionServerLicenseServerStack.Outputs.SecurityGroup
- ''
LicenseServerPrivateDNS: !If
- DoDeployLicenseServer
- !GetAtt MatlabProductionServerLicenseServerStack.Outputs.ServerPrivateDNS
- ''
Loading