Part 3 - Deploying Sample Web Application by Using the Publish to Elastic Beanstalk Wizard
In this part, you will be using “Publish to Elastic Beanstalk Wizard” within AWS Visual Studio extension to publish the sample ASP.NET Web Application to AWS Elastic Beanstalk.
1. In Solution Explorer, open the context (right-click) menu for the AWSEbWebAppDemo project folder for the project you created in the previous section and choose Publish to AWS Elastic Beanstalk.
In the next steps you will be configuring AWS Elastic Beanstalk properties.
2. In Profile, from the Account profile to use for deployment drop-down list, choose the AWS account profile you want to use for the deployment.
3. From the Region drop-down list, choose the region to which you want Elastic Beanstalk to deploy the application
4. In Deployment Target, choose “Create a new application environment”. Choose Next
5. Name drop-down list proposes a default name for the application. (AWSEbWebAppDemo)
6. In the Environment area, in the Name drop-down list, choose AWSEbWebAppDemo-dev
7. In the URL box, type a unique subdomain name that will be the URL for your web application. (e.g. put your initials after awsebwebappdemo-dev) Choose Check Availability to make sure the URL for your web application is not already in use. Click Next
8. In Amazon EC2 Launch Configuration, from the Container type dropdown list, choose 64bit Windows Server 2016 v1.2.0 running IIS 10.0
9. In the Instance type drop-down list, specify t2.micro as the Amazon EC2 instance type to use. This will minimize the cost associated with running the instance.
10. In the Key pair drop-down list, choose an existing Amazon EC2 instance key pair to use to sign in to the instances that will be used for your application
In this window, you will also see additional optional configuration options as follows:
11. Use non-default VPC
This option will allow you to deploy application environment in a VPC. The VPC must have already been created including at least one public and one private subnet. Elastic Load Balancer for your application will be deployed to public subnet which is associated with a routing table that has an entry that points to an internet gateway. Instances created for your application will be placed in the private subnet.
12. Single Instance environment
This option allows you to launch only a single Amazon EC2 instance rather than a fully load balanced, automatically scaled environment.
13. Enable rolling deployments
AWS Elastic Beanstalk provides several options for how deployments are processed. With rolling deployments, Elastic Beanstalk splits the environment’s EC2 instances into batches and deploys the new version of the application to one batch at a time, leaving the rest of the instances in the environment running the old version of the application. During a rolling deployment, some instances serve requests with the old version of the application, while instances in completed batches serve other requests with the new version.
For this lab, uncheck all three boxes and click Next.
14. On the Permissions page, accept default values aws-elasticbeanstalk-ec2-role and aws-elasticbeanstalk-service-role. Deployed Application Permissions will be used to delivery AWS credentials to your applications so that it can access AWS resources. Service Permissions will allow Elastic Beanstalk service to monitor environment.
15. In the Build and IIS Deployment Settings area, specify target build configuration as Release.
16. In App Path box, accept the default path (Default Web Site/) that IIS will use to deploy application.
17. In the Health Check URL box, type /api/values. Elastic Beanstalk will use this URL to determine if your web application is still responsive.
Status page for the deployment will open. The deployment may take a few minutes. When the deployment is complete, you should see Status: “Environment is healthy” and you can proceed to next step.