AD Connector is designed to give you an easy way to establish a trusted relationship between your Active Directory and AWS. When AD Connector is configured, the trust allows you to:
- Sign in to AWS applications such as Amazon WorkSpaces, Amazon WorkDocs, and Amazon WorkMail by using your Active Directory credentials.
- Seamlessly join Windows instances to your Active Directory domain either through the Amazon EC2 launch wizard or programmatically through the EC2 Simple System Manager (SSM) API.
- Provide federated sign-in to the AWS Management Console by mapping Active Directory identities to AWS Identity and Access Management (IAM) roles.
In this walkthrough, I demonstrate the use case of seamlessly joining Windows instances to your on premises AD.
To keep it simple, rather than use an on-premises AD, this will be simulated using an EC2 instance. In real life, you would need a VPN or Direct Connect. I used a Windows 2012 R2 Base, with an instance type of t2.medium, choosing the default VPC and subnet in AZ A. In real life it would have a static IP address, but the test worked fine using the dynamic private address.
For the Security Group, which in real life would be the on premises firewall, and just for the short duration of the test, I opened up all inbound traffic. See the link below for the actual required ports, which need to allow DNS, Kerberos and LDAP from the CIDR ranges of the AD Connector subnets.
Once ready, RDP to the public address of the instance and configure it as a domain controller.
As it is a while since I worked with AD, I followed the following article.
I used the domain name onprem.com.
Create a service account which will be used by the AD connector. Follow the instructions here:
Alternatively, you could use a Domain Admin account when creating the AD connector later, but creating a service account with the minimum necessary privileges is best practice.
Now for main part of the walkthrough: creating an AD Connector.
In the AWS console, choose Directory Service, Set up a Directory, AD Connector, Small option. Note that its about $0.05 an hour, but free trail eligible for a month. I chose the default VPC and subnets in AZ A and AZ B.
Supply the Directory name onprem.com and Netbios name onprem.
Supply the IP address of the Domain Controller
Supply the Service Account Username and Password that you created earlier.
It takes about 5 minutes to create the AD Connector.
Now to test it by joining a new Windows Server to the on-premises domain.
Launch a Windows instance. I used 2012 R2 Base again, launching it into the default VPC, subnet in AZ A.
The interesting bit is on the Configure Instance page, where you choose Domain Join Directory and see the onprem.com domain name available. Note that it say that for the domain join to succeed, select an IAM role that has the AWS managed policies AmazonSSMManagedInstanceCore and AmazonSSMDirectoryServiceAccess attached to it. You can choose to have it create the role you, and supply a name. I called it ADConnectorRole.
I tagged the instance “Member Server”
You can now RDP into it using the credentials of a Domain User account. I used onprem\administrator.
To clean up:
Delete the AD Connector Directory
Terminate the member server and the domain controller