Part 2. Updating the Sample ASP.NET Core Web Application Project

This part of the lab we will use AWS Cloud9 IDE to update the project source code. These updates will trigger your continuous deployment pipeline and your changes will be reflected once the pipeline successfully completes.

2. On AWS Cloud9 main page for myapp, make sure myapp root directory is chosen and then go to console

3. AWS Cloud9 command line guides you about how to work with your source control system. As shown in the picture below, change the working directory from environment to myapp by copy & pasting the part highlighted below.

4. Type “git status” to ensure no changes to be committed to the code repository.

5. On left pane navigate to the directory shown below and double click Index.cshtml document

6. The contents of the document is opened on the right side of the editor. Change the text within <h1> tags and make is something different than “Congratulations!”. Or copy in all of the code below:

    ViewData["Title"] = "Example app";
<a class="twitter-link" href=" just hosted a website on AWS!"><img src="img/tweet.svg" /></a>
<div class="text">
    <h1>I am working from @Environment.MachineName</h1>

7. Now click Save then go back to AWS CodeStar command line and type “Git Status” again. See that your changes created a delta with the source control system.

8. On the command line type the following:

git add A .
git commit -m "Updates on index.cshtml"
git push -u origin master

9. Now you pushed the changes to your source control (AWS CodeCommit) this will trigger your pipeline. Go back to AWS CodeStar dashboard. On the left review the Continuous deployment section.

10. Once the pipeline completes successfully visit the Application endpoint again to see that the changes are deployed to your server.