Part 5 - Modifying and Re-Deploying the web application (optional)

If you have time, you can modify and then deploy an updated version of the application using Elastic Beanstalk.

1. In the Solution Explorer pane, expand the project tree, expand the Controllers folder and double-click on ValuesController.cs:

2. Navigate to this portion of the source code in the VaulesController.cs file:

3. Replace the highlighted lines (lines 12 through 22) with the following code:

	static string[] map = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };

    // GET api/values
    public IEnumerable<string> Get()
        {
			return map;
        }

    // GET api/values/5
    public string Get(int id)
        {
            if (id < 0 || id > 9)
			{
                return "Value outside of the range";
			}
            return map[id];
        }

4. In Solution Explorer, open the context menu for the AWSEbWebAppDemo project folder for the project you created and choose Publish to AWS Elastic Beanstalk

5. In the Application screen select Redeploy to an existing environment and highlight your environment that you created in the previous step; click Next:

6. Elastic beanstalk remembers your previous settings, so you may click through subsequent screens and then click Deploy

You will see that Elastic Beanstalk performs the update of your application:

7. When you see the message that Environment is healthy, you may proceed to testing the updated application:

8. Now you will see that the API returns the expected values based on your recent changes: