|
| 1 | +# Integrate AWS Active Directory (AD) with MATLAB and Network License Manager (NLM) |
| 2 | + |
| 3 | +This Infrastructure as Code (IaC) building block shows admins how to integrate [AWS® Directory Service®](https://aws.amazon.com/directoryservice/) with the [MATLAB® reference architecture](https://github.com/mathworks-ref-arch/matlab-on-aws-win) on AWS and the [Network License Manager for MATLAB (NLM)](https://github.com/mathworks-ref-arch/license-manager-for-matlab-on-aws) on AWS. |
| 4 | + |
| 5 | +After administrators deploy this building block, AWS services automatically detect MATLAB reference architecture Windows® instances when end users deploy them. AWS then joins these instances to the Active Directory (AD) domain. This configuration enables end users to license MATLAB using their AD credentials. |
| 6 | + |
| 7 | +You can customize this template depending on your organization's infrastructure and deploy it in a single VPC. To enable multi-account and multi-VPC setups instead, see the AWS blog post: [How to seamlessly domain join Amazon EC2® instances to a single AWS Managed Microsoft AD Directory from multiple accounts and VPCs](https://aws.amazon.com/blogs/security/how-to-domain-join-amazon-ec2-instances-aws-managed-microsoft-ad-directory-multiple-accounts-vpcs/). |
| 8 | + |
| 9 | +To learn more about AWS Directory Service, see the [AWS Directory Service FAQs](https://aws.amazon.com/directoryservice/faqs/). |
| 10 | + |
| 11 | +## Requirements |
| 12 | + |
| 13 | +You need: |
| 14 | + |
| 15 | +* A MATLAB network license. For more information, see [License Requirements for MATLAB on Cloud Platforms](https://www.mathworks.com/help/install/license/licensing-for-mathworks-products-running-on-the-cloud.html). |
| 16 | +* An [Amazon Web Services (AWS)](https://aws.amazon.com) account. |
| 17 | +* A key pair for your AWS account, in the appropriate region. For more information, see [Amazon EC2 Key Pairs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html). |
| 18 | + |
| 19 | +## Costs |
| 20 | + |
| 21 | +You are responsible for the cost of the AWS services used when you create cloud resources using this guide. Resource settings, such as instance type, affect the cost of deployment. For cost estimates, see the pricing pages for each AWS service you will be using. Prices are subject to change. |
| 22 | + |
| 23 | +## Deployment |
| 24 | + |
| 25 | +Click the "Launch Stack" button to open the CloudFormation console. Ensure that you log in to your AWS account before clicking the button. |
| 26 | + |
| 27 | + [](https://console.aws.amazon.com/cloudformation/home?#/stacks/create/review?templateURL=https://mathworks-reference-architectures-templates.s3.us-east-1.amazonaws.com/active-directory/v1/0/0/active-directory.yaml) |
| 28 | + |
| 29 | +You are prompted to provide these parameters. |
| 30 | +If you do not know the value of any of these parameters, contact your AD admin. |
| 31 | + |
| 32 | +| **Parameter Label** | **Description** | |
| 33 | +|----------------------------------------|-----------------------------------------------------------------------------------------------------------| |
| 34 | +| Active Directory NetBIOS Name | The NetBIOS name of your existing AD domain, for example, `CORP`. For details, see the Microsoft® documentation on [Naming conventions in Active Directory for computers, domains, sites, and OUs](https://learn.microsoft.com/troubleshoot/windows-server/active-directory/naming-conventions-for-computer-domain-site-ou) | |
| 35 | +| Active Directory DNS Domain Name | The fully qualified DNS domain name of your AD, for example, `corp.example.com`.| |
| 36 | +| Active Directory Target OU | The organizational unit (OU) where your domain joined server will reside, for example, `OU=Computers,OU=CORP,dc=corp,dc=example,dc=com`. For details, see the Microsoft® documentation on [Create an Organizational Unit (OU) in a Microsoft Entra Domain Services managed domain](https://learn.microsoft.com/entra/identity/domain-services/create-ou) | |
| 37 | +| Active Directory Admin Password | The password you set for the AWS AD administrator account. | |
| 38 | +| License Manager Dashboard Password | The password you set for the MATLAB License Manager dashboard. You need this password to install your license file. The username is `manager`. | |
| 39 | +| Allowed IP Addresses for Dashboard | Comma-separated list of IP address ranges that can access the NLM instance. Each IP CIDR should be formatted as <ip_address>/<mask>. The mask determines the number of IP addresses to include. A mask of 32 is a single IP address. Example of allowed values: 10.0.0.1/32 or 10.0.0.0/16,192.34.56.78/32. This calculator can be used to build a specific range: https://www.ipaddressguide.com/cidr. To determine which address is appropriate, contact your IT administrator. | |
| 40 | +| EC2 Key Pair Name | The name of an existing EC2 Key Pair for SSH access to Network License Manager and MATLAB Windows instances. | |
| 41 | + |
| 42 | +After you deploy the stack, use these outputs to integrate AWS Directory Service with the MATLAB reference architecture and the Network License Manager. |
| 43 | + |
| 44 | +- `NLMDashboardURL`: Use this URL to access the License Manager dashboard. Upload your network license file here. For details, see [Network License Manager for MATLAB on AWS](https://github.com/mathworks-ref-arch/license-manager-for-matlab-on-aws/blob/master/releases/v1/latest/README.md). |
| 45 | +- `MATLABWindowsDeploymentUrl`: Share this URL with your users. The URL allows users to deploy a Windows instance with MATLAB joined to your Active Directory domain in the specified VPC and subnet. Users can then connect to it using their AD credentials. You can replace MATLAB version in the URL with the desired MATLAB release version as needed. Note that the MATLAB EC2 instance will be rebooted after deployment, so a brief initialization period is expected while it joins Active Directory before you can remotely connect to the instance. For more information about the supported MATLAB versions, see [MATLAB on AWS Reference Architecture](https://github.com/mathworks-ref-arch/matlab-on-aws-win). |
| 46 | +- `EC2JoinExecutionURL`: If you have customized the deployment template to use an existing VPC, use this URL to manually join existing Windows EC2 instances to the AD domain. New MATLAB Windows EC2 instances deployed in the VPC are automatically joined to the AD domain. |
| 47 | + |
| 48 | +## Learn About Architecture |
| 49 | + |
| 50 | +The CloudFormation stack creates these resources in your AWS account. |
| 51 | + |
| 52 | +- A VPC with public and private subnets. For details, see [VPC IaC Building Block](https://github.com/mathworks-ref-arch/iac-building-blocks/tree/main/aws/vpc-template/v1). |
| 53 | +- Network License Manager for MATLAB in the VPC. For details, see [Network License Manager for MATLAB on AWS](https://github.com/mathworks-ref-arch/license-manager-for-matlab-on-aws). |
| 54 | +- AWS Managed Microsoft AD. |
| 55 | +- Secrets Manager to store AD credentials. |
| 56 | +- An EC2 Systems Manager (SSM) Automation runbook. |
| 57 | +- Lambda and EventBridge. |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +This template uses [event-driven architecture](https://aws.amazon.com/blogs/modernizing-with-aws/event-driven-active-directory-domain-join-with-amazon-eventbridge/) to automatically integrate new MATLAB EC2 instances with the AD domain. |
| 62 | +When a user deploys a new EC2 instance in the same VPC as that of AD setup, AWS EventBridge captures this event. |
| 63 | +EventBridge then triggers a Lambda function which validates the VPC and tags of the instance. If valid, it invokes the custom SSM automation runbook. |
| 64 | +The SSM automation runbook fetches the AD secrets from AWS Secret Manager. It then uses the SSM agent on the EC2 instance to enable the instance to join the AD domain. It also configures the DCV server on the EC2 instance to allow AD login from the DCV client. It then applies tags based on the success or failure of the domain join operation. |
| 65 | + |
| 66 | +This image shows the full workflow. |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | +To remove any Windows EC2 instances from the AD domain after they are joined, see this AWS blog post on [Event-driven Active Directory domain join with Amazon EventBridge](https://aws.amazon.com/blogs/modernizing-with-aws/event-driven-active-directory-domain-join-with-amazon-eventbridge/). |
| 71 | + |
| 72 | +## Technical Support |
| 73 | + |
| 74 | +To request assistance or additional features, contact [MathWorks Technical Support](https://www.mathworks.com/support/contact_us.html). |
| 75 | + |
| 76 | +---- |
| 77 | + |
| 78 | +Copyright 2026 The MathWorks, Inc. |
| 79 | + |
| 80 | +---- |
0 commit comments