Tutorial: How to Deploy a .NET Sample Application Using AWS Elastic Beanstalk
In this tutorial, you will learn how to deploy a .NET sample application to AWS Elastic Beanstalk using the AWS Toolkit for Visual Studio.
Note
This tutorial uses a sample ASP.NET Web application that you can download here. It also uses the Toolkit for Visual Studio and was tested using Visual Studio Professional 2012.
Step 1. Create the Environment
First, use the Create New Application wizard in the Elastic Beanstalk console to create the application environment.
To create the environment
Open the Elastic Beanstalk console.
Note
If the New Environment wizard does not show the screens described below, refer to AWS Quick Start Guide: Web App Deployment.
Choose Create New Application.

On the Application Information page, enter an Application name, and then choose Next.

On the New Environment page, choose Create web server.

On the Environment Type page, for Predefined configuration, choose IIS.

For Environment type, accept the default, Load balancing, auto scaling, and then choose Next.

On the Application Version page, for Source, choose Sample application, and then choose Next.

On the Environment Information page, accept all defaults, and then choose Next.

On the Additional Resources page, choose Create an RDS DB instance with this environment, and then choose Next.

On the Configuration Details page, for Instance type, choose
t2.micro.Accept the default values for the other fields, and then choose Next.

On the Environment Tags page, leave both the Key and the Value fields blank, and then choose Next.

Choose Next on the Permissions page. If you don't have a default instance profile and service role, Elastic Beanstalk creates them for you.
On the RDS Configuration page, for DB engine, choose sqlserver-ex. For Instance class, choose db.t2.micro, and then increase the Allocated storage to
20 GB.
Create a Username and Password, and then choose Next.
On the Review Information page, review the settings, and then choose Launch.
To check launch status, see the Dashboard page in the Elastic Beanstalk console.

Step 2. Publish Your Application to Elastic Beanstalk
Use the AWS Toolkit for Visual Studio to publish your application to Elastic Beanstalk.
To publish your application to Elastic Beanstalk
Ensure that your environment launched successfully by checking the Health status in the Elastic Beanstalk console. It should be Green.

In Visual Studio, open BeanstalkDotNetSample.sln.
Note
If you haven't done so already, you can get the sample here.
On the View menu, choose Solution Explorer.
Expand Solution ‘BeanstalkDotNetSample’ (2 projects).
Open the context (right-click) menu for MVC5App, and then choose Publish to AWS.

On the Publish to AWS Elastic Beanstalk page, for Deployment Target, choose the environment that you just created, and then choose Next.

On the Application Options page, accept all of the defaults, and then choose Next.

On the Review page, choose Deploy.

If you want to monitor deployment status, use the NuGet Package Manager in Visual Studio.

When the application has successfully been deployed, the Output box displays completed successfully.

Return to the Elastic Beanstalk console and choose the name of the application, which appears next to the environment name.

Your ASP.NET application opens in a new tab.

Step 3. Clean Up Your AWS Resources
After your application has deployed successfully, learn more about Elastic Beanstalk by watching the video in the application.
If you are done working with Elastic Beanstalk for now, you can terminate your .NET environment.
To terminate your Elastic Beanstalk environment
Open the Elastic Beanstalk console.
Navigate to the management console for your environment.
Choose Actions and then choose Terminate Environment.
Elastic Beanstalk cleans up all AWS resources associated with your environment, including EC2 instances, DB instance, load balancer, security groups, CloudWatch alarms, etc.
For more information, see Creating and Deploying Elastic Beanstalk Applications in .NET Using AWS Toolkit for Visual Studio, the AWS .NET Development Blog, or the AWS Application Management Blog.

