This is a sample application demonstrating joining an MVC ASP.NET application hosted on AWS Elastic Beanstalk to an AD directory hosted on AWS Directory Service.
This is the sample code for the article Joining Elastic Beanstalk to AWS Directory Service.
- Visual Studio 2013 or later
- AWS Toolkit for Visual Studio
- An AWS account
- Create a CloudFormation stack using the included CloudFormation template.
- Load the included web application into Visual Studio 2013 or later.
- Modify
.ebextensions/JoinDomain.config
and replace "your ssm document name" with the name of your SSM document created in step 1. - Publish your application to the "Publish" folder using the "ElasticBeanstalk" publishing profile.
- Create your Elastic Beanstalk application, ensuring:
- Your app is in the same VPC as your directory.
- Use the generated deployment package ZIP file from step 4.
- Use the IAM Role generated by step 1.
- After your EB application is deployed, modify the configuration and change the HTTP listener to a TCP listener.
- Point your browser to your EB endpoint, you should see the front page.
- Click "Go Secured". You should be prompted for a username and password. Use the domain short name you specified in step 1 followed by "\Administrator" for the username. For example, "CORP\Administrator". Use the password you specified in step 1.
The CloudFormation template creates the following resources:
- A small Simple AD directory,
- The SSM document to join the domain,
- IAM Role to be used by your Elastic Beanstalk EC2 instances.