1 00:00:00,350 --> 00:00:03,480 ‫Okay, so let's have a look at the different code services. 2 00:00:03,480 --> 00:00:04,690 ‫So let's start with CodeCommit. 3 00:00:04,690 --> 00:00:06,300 ‫I'm going to go in here. 4 00:00:06,300 --> 00:00:08,240 ‫As we can see, we have CodeCommit. 5 00:00:08,240 --> 00:00:11,010 ‫We have CodeArtifacts, CodeBuild, CodeDeploy, 6 00:00:11,010 --> 00:00:13,570 ‫and CodePipeline available from the left hand side 7 00:00:13,570 --> 00:00:15,120 ‫as standalone tools. 8 00:00:15,120 --> 00:00:17,540 ‫So we could go ahead and use all of them one by one, 9 00:00:17,540 --> 00:00:19,210 ‫but that would be very complicated. 10 00:00:19,210 --> 00:00:21,330 ‫But as you can see here, for example, for CodeCommits, 11 00:00:21,330 --> 00:00:22,620 ‫you have zero repository, 12 00:00:22,620 --> 00:00:25,120 ‫but you can create a new code repository very quickly 13 00:00:25,120 --> 00:00:27,650 ‫by clicking on this code, and get started. 14 00:00:27,650 --> 00:00:29,720 ‫But for now, what I want to show you 15 00:00:29,720 --> 00:00:32,170 ‫is how we can get started with all of them at once, 16 00:00:32,170 --> 00:00:33,780 ‫using only one service. 17 00:00:33,780 --> 00:00:35,780 ‫And that service is CodeStar. 18 00:00:35,780 --> 00:00:38,260 ‫So if we go to CodeStar, we can see now there's 19 00:00:38,260 --> 00:00:41,640 ‫only one left hand side tool on the bar. 20 00:00:41,640 --> 00:00:44,360 ‫And so I'm going to create a project and get started 21 00:00:44,360 --> 00:00:47,120 ‫with creating a service role for good start to work. 22 00:00:47,120 --> 00:00:48,820 ‫So this is working, great. 23 00:00:48,820 --> 00:00:51,790 ‫And then we're going to create an application 24 00:00:51,790 --> 00:00:54,740 ‫that is going to run on Elastic Beanstalk. 25 00:00:54,740 --> 00:00:56,460 ‫And maybe we'll use Python. 26 00:00:56,460 --> 00:00:59,760 ‫So here we have Python (Flask), which is a web service 27 00:00:59,760 --> 00:01:02,850 ‫running on AWS Elastic Beanstalk. 28 00:01:02,850 --> 00:01:04,420 ‫Just for an example, right. 29 00:01:04,420 --> 00:01:06,050 ‫I'll click on Next. 30 00:01:06,050 --> 00:01:09,280 ‫And here we are going to call this "DemoProject." 31 00:01:10,460 --> 00:01:12,590 ‫The repo is going to be CodeCommit, 32 00:01:12,590 --> 00:01:15,160 ‫so it's going to create a code repository for us. 33 00:01:15,160 --> 00:01:18,070 ‫The instances are going to be to be t2micro. 34 00:01:18,070 --> 00:01:20,440 ‫And we don't... 35 00:01:20,440 --> 00:01:23,410 ‫We're just going to create a key pair for us to get started. 36 00:01:23,410 --> 00:01:24,773 ‫So let's go into EC2. 37 00:01:25,620 --> 00:01:27,143 ‫And I'm just going to create a dummy key pair 38 00:01:27,143 --> 00:01:29,450 ‫for this hands-on, in case you don't have one. 39 00:01:29,450 --> 00:01:31,470 ‫So I work with multiple accounts, 40 00:01:31,470 --> 00:01:33,950 ‫so sometimes I don't have all the key pairs 41 00:01:33,950 --> 00:01:34,783 ‫in all the accounts. 42 00:01:34,783 --> 00:01:35,880 ‫So here we go. 43 00:01:35,880 --> 00:01:37,561 ‫Key pair is created, and if I refresh, 44 00:01:37,561 --> 00:01:39,240 ‫I can select this dummy key pair. 45 00:01:39,240 --> 00:01:40,210 ‫Great. 46 00:01:40,210 --> 00:01:42,890 ‫I click on next and then create the projects. 47 00:01:42,890 --> 00:01:45,624 ‫And so CodeStar is going to set up the project resources, 48 00:01:45,624 --> 00:01:48,640 ‫and that may take a few minutes, and so what I'm going to do 49 00:01:48,640 --> 00:01:51,020 ‫is pause the video until all of this is done 50 00:01:51,020 --> 00:01:52,220 ‫to show you the results. 51 00:01:53,310 --> 00:01:54,590 ‫So let me refresh this page. 52 00:01:54,590 --> 00:01:55,690 ‫It's been a while now. 53 00:01:56,710 --> 00:01:59,130 ‫And my CodeStar Project has been set up. 54 00:01:59,130 --> 00:02:01,870 ‫So let's have a look at what has happened. 55 00:02:01,870 --> 00:02:05,400 ‫So as we can see, there was a pipeline that has been created 56 00:02:05,400 --> 00:02:07,360 ‫and has been executed. 57 00:02:07,360 --> 00:02:09,120 ‫If we look at the project resources, 58 00:02:09,120 --> 00:02:10,590 ‫a lot has been created for us. 59 00:02:10,590 --> 00:02:13,880 ‫So an Elastic Beanstalk application has been created. 60 00:02:13,880 --> 00:02:17,010 ‫A CodePipeline, a CodeCommit repository, 61 00:02:17,010 --> 00:02:19,730 ‫a CodeBuild project, and CloudFormation stack. 62 00:02:19,730 --> 00:02:22,060 ‫So a lot of things have been created for us. 63 00:02:22,060 --> 00:02:24,630 ‫So let's explore all these things one by one. 64 00:02:24,630 --> 00:02:26,265 ‫So if we go to CodePipeline, 65 00:02:26,265 --> 00:02:28,870 ‫we can see on the left hand side, it's CodePipeline. 66 00:02:28,870 --> 00:02:30,510 ‫So we saw that there was a source, 67 00:02:30,510 --> 00:02:33,450 ‫which had the application code in CodeCommit 68 00:02:33,450 --> 00:02:34,950 ‫that was pulled. 69 00:02:34,950 --> 00:02:38,410 ‫Then it was sent to CodeBuild to build the project, 70 00:02:38,410 --> 00:02:39,770 ‫which succeeded. 71 00:02:39,770 --> 00:02:42,980 ‫And then it was being deployed by CloudFormation 72 00:02:42,980 --> 00:02:44,670 ‫into Elastic Beanstalk. 73 00:02:44,670 --> 00:02:48,430 ‫Okay, so all of this was orchestrated by CodePipeline. 74 00:02:48,430 --> 00:02:50,340 ‫So as you can see, CodeDeploy is not being used 75 00:02:50,340 --> 00:02:51,173 ‫in this project. 76 00:02:51,173 --> 00:02:52,800 ‫CodeBuild is being used. 77 00:02:52,800 --> 00:02:54,530 ‫So we can see the fact that yes, 78 00:02:54,530 --> 00:02:56,412 ‫a demo project was created here. 79 00:02:56,412 --> 00:03:00,140 ‫CodeArtifact is not being used and CodeCommit is being used. 80 00:03:00,140 --> 00:03:02,766 ‫And if you go into CodeCommit, as we can see, 81 00:03:02,766 --> 00:03:05,512 ‫in the project we see directories and files, 82 00:03:05,512 --> 00:03:09,150 ‫which represents the code repository itself. 83 00:03:09,150 --> 00:03:12,688 ‫So it really shows you a bunch of the Code Developer Tools 84 00:03:12,688 --> 00:03:16,360 ‫associated with CodeStar in this lecture. 85 00:03:16,360 --> 00:03:19,190 ‫But more importantly, if we go to Beanstalk, 86 00:03:19,190 --> 00:03:21,192 ‫and in Beanstalk we can see the application. 87 00:03:21,192 --> 00:03:24,220 ‫If I click on this URL right here, 88 00:03:24,220 --> 00:03:28,130 ‫it takes me into the project itself, 89 00:03:28,130 --> 00:03:29,370 ‫which has been deployed on Beanstalk. 90 00:03:29,370 --> 00:03:30,733 ‫And it says, "Output. Hello World," 91 00:03:30,733 --> 00:03:33,070 ‫which shows that the application is working. 92 00:03:33,070 --> 00:03:35,880 ‫Not very impressive, but still, it was being set up. 93 00:03:35,880 --> 00:03:37,350 ‫And now we're ready to work. 94 00:03:37,350 --> 00:03:41,960 ‫So finally, the last thing I want to show you is Cloud9. 95 00:03:41,960 --> 00:03:45,900 ‫So if I set up Cloud9, this is going to give me an IDE. 96 00:03:45,900 --> 00:03:49,620 ‫So if I go to IDE here, we can access the environment 97 00:03:49,620 --> 00:03:53,070 ‫either using Cloud9 or CodeCommits, 98 00:03:53,070 --> 00:03:54,823 ‫or some tools that we can use locally, 99 00:03:54,823 --> 00:03:56,450 ‫such as the command line interface, 100 00:03:56,450 --> 00:03:57,700 ‫Visual Studio, and so on. 101 00:03:57,700 --> 00:03:59,990 ‫But let's create Cloud9, 102 00:03:59,990 --> 00:04:02,200 ‫because I want to use a Cloud9 environment. 103 00:04:02,200 --> 00:04:03,715 ‫So I'm going to create a Cloud9 environment 104 00:04:03,715 --> 00:04:05,410 ‫of type t2 micro. 105 00:04:05,410 --> 00:04:09,117 ‫And this is an environment, so I'll call it "DemoEnv." 106 00:04:10,370 --> 00:04:12,210 ‫And for cost-saving settings, 107 00:04:12,210 --> 00:04:14,120 ‫after 30 minutes of inactivity, 108 00:04:14,120 --> 00:04:16,090 ‫let's shut down the instance. 109 00:04:16,090 --> 00:04:18,857 ‫And this is going to create for me my cloud IDE. 110 00:04:20,274 --> 00:04:23,423 ‫So let's wait a little bit until this is created. 111 00:04:24,780 --> 00:04:26,170 ‫And actually, while this is creating, 112 00:04:26,170 --> 00:04:29,110 ‫so let me just refresh this page. 113 00:04:29,110 --> 00:04:30,470 ‫So while this is being created, 114 00:04:30,470 --> 00:04:32,150 ‫and I'll just wait a little bit, 115 00:04:32,150 --> 00:04:35,770 ‫we can see that from within the CodeStar UI, 116 00:04:35,770 --> 00:04:37,550 ‫we can see the repo details, 117 00:04:37,550 --> 00:04:40,890 ‫as well as some information around CodeCommits. 118 00:04:40,890 --> 00:04:42,440 ‫We can see the pipeline itself, 119 00:04:42,440 --> 00:04:44,900 ‫so we don't need to go directly into CodePipeline to see it. 120 00:04:44,900 --> 00:04:48,750 ‫We can also see it in this UI, which is quite neat. 121 00:04:48,750 --> 00:04:51,010 ‫We have some information around monitoring, 122 00:04:51,010 --> 00:04:52,270 ‫which is going to give us some settings 123 00:04:52,270 --> 00:04:55,460 ‫around the Amazon EC2 metrics and so on. 124 00:04:55,460 --> 00:04:57,680 ‫And issues, if we wanted to integrate 125 00:04:57,680 --> 00:05:00,360 ‫with an external issue tracking system 126 00:05:00,360 --> 00:05:01,880 ‫such as Jira. 127 00:05:01,880 --> 00:05:04,200 ‫But let's go back to our IDE 128 00:05:04,200 --> 00:05:07,650 ‫and wait for our Cloud9 environment to be provisioned. 129 00:05:07,650 --> 00:05:08,483 ‫And for this, 130 00:05:08,483 --> 00:05:12,740 ‫if you go into the CloudFormation service right here, 131 00:05:12,740 --> 00:05:14,800 ‫we will be able to see the fact that it is 132 00:05:14,800 --> 00:05:16,560 ‫in "create in progress" state. 133 00:05:16,560 --> 00:05:17,910 ‫So let's wait a little bit. 134 00:05:18,780 --> 00:05:20,790 ‫So my CloudFormation stack is now created, 135 00:05:20,790 --> 00:05:24,080 ‫so my Cloud9 environment is ready. 136 00:05:24,080 --> 00:05:26,360 ‫And I refresh this page to access this. 137 00:05:26,360 --> 00:05:28,860 ‫And so if I click on "Open IDE," 138 00:05:28,860 --> 00:05:31,240 ‫I'm going to get directly into the Cloud9. 139 00:05:31,240 --> 00:05:34,510 ‫And as we can see, this is a web browser. 140 00:05:34,510 --> 00:05:37,370 ‫So everything is running from the web browser, 141 00:05:37,370 --> 00:05:40,280 ‫but this allows you to just run your code 142 00:05:40,280 --> 00:05:43,020 ‫and edit your code directly from within the web browser, 143 00:05:43,020 --> 00:05:44,300 ‫which is really cool. 144 00:05:44,300 --> 00:05:46,970 ‫You get a command line interface as well 145 00:05:46,970 --> 00:05:49,330 ‫from within the web browser to talk to your code 146 00:05:49,330 --> 00:05:52,350 ‫if you wanted to or run some commands, which is awesome. 147 00:05:52,350 --> 00:05:54,550 ‫And you can literally edit your code from 148 00:05:54,550 --> 00:05:55,383 ‫within a web browser. 149 00:05:55,383 --> 00:05:58,640 ‫And if someone else were to connect to this 150 00:05:58,640 --> 00:05:59,473 ‫at the same time as me, 151 00:05:59,473 --> 00:06:03,670 ‫we could edit the code together at the same time. 152 00:06:03,670 --> 00:06:06,320 ‫So this is quite neat, because I can run this web browser 153 00:06:06,320 --> 00:06:09,400 ‫from any IDE. 154 00:06:09,400 --> 00:06:10,520 ‫from any web browser 155 00:06:10,520 --> 00:06:12,480 ‫from anyone's work laptop. 156 00:06:12,480 --> 00:06:14,600 ‫And so that means that I can be efficient, 157 00:06:14,600 --> 00:06:17,080 ‫and I don't need to set up anything on my computer. 158 00:06:17,080 --> 00:06:18,949 ‫And so if we, for example, 159 00:06:18,949 --> 00:06:21,730 ‫were to look at some configuration. 160 00:06:21,730 --> 00:06:24,140 ‫So this 'helloworld' thing, and there's this 161 00:06:24,140 --> 00:06:27,260 ‫like an application, that py file. 162 00:06:27,260 --> 00:06:30,360 ‫We can see, for example, here, the method is 'GET', 163 00:06:30,360 --> 00:06:32,240 ‫and the output was "Hello World." 164 00:06:32,240 --> 00:06:35,770 ‫And so I say, "Hello World Stephane." 165 00:06:35,770 --> 00:06:37,190 ‫And I'm just going to change this, right, 166 00:06:37,190 --> 00:06:38,680 ‫so I'm going to save this file. 167 00:06:38,680 --> 00:06:40,740 ‫So now it's saved. 168 00:06:40,740 --> 00:06:43,950 ‫And now I just need to commit this file into gits. 169 00:06:43,950 --> 00:06:45,740 ‫So in the left hand sides have gits, 170 00:06:45,740 --> 00:06:48,180 ‫so I can apply this change right here. 171 00:06:48,180 --> 00:06:49,640 ‫So this is working. 172 00:06:49,640 --> 00:06:53,707 ‫And then I can just say, "edit welcome message." 173 00:06:54,600 --> 00:06:57,719 ‫Okay, and then click on this, sorry, 174 00:06:57,719 --> 00:07:01,490 ‫enter or Control + Enter maybe, to be done. 175 00:07:01,490 --> 00:07:04,450 ‫So now the file has been committed. 176 00:07:04,450 --> 00:07:08,160 ‫And the only thing I need to do now is git push. 177 00:07:08,160 --> 00:07:11,233 ‫So if I do, and where is it? 178 00:07:12,260 --> 00:07:14,010 ‫So I need to go to "my project". 179 00:07:14,010 --> 00:07:16,240 ‫So demo project, and I do git push. 180 00:07:16,240 --> 00:07:19,840 ‫This is going to push the code directly into my code commit. 181 00:07:19,840 --> 00:07:21,350 ‫So if I go back in here, 182 00:07:21,350 --> 00:07:23,893 ‫into CodeStar and go to repository, 183 00:07:25,920 --> 00:07:28,527 ‫there was a commit that was done right now called, 184 00:07:28,527 --> 00:07:30,520 ‫"edit welcome message." 185 00:07:30,520 --> 00:07:32,206 ‫And this commit that was being done 186 00:07:32,206 --> 00:07:34,910 ‫is going to trigger my pipeline. 187 00:07:34,910 --> 00:07:36,980 ‫And the whole thing is going to happen just again. 188 00:07:36,980 --> 00:07:40,490 ‫So, as we can see, the source was just succeeded right now. 189 00:07:40,490 --> 00:07:42,330 ‫Now we are in the CodeBuild phase, 190 00:07:42,330 --> 00:07:44,540 ‫so the code is being built again. 191 00:07:44,540 --> 00:07:45,610 ‫And then it will be deployed. 192 00:07:45,610 --> 00:07:47,717 ‫So let me wait a little bit to show you the effect of this. 193 00:07:47,717 --> 00:07:50,020 ‫But as you can see right now, if I refresh, 194 00:07:50,020 --> 00:07:52,010 ‫it just says "Output. Hello World." 195 00:07:52,010 --> 00:07:53,140 ‫And at the end of the pipeline, 196 00:07:53,140 --> 00:07:55,290 ‫we should see something else. 197 00:07:55,290 --> 00:07:58,370 ‫And so it turns out that my CodeBuild has failed. 198 00:07:58,370 --> 00:07:59,203 ‫And this is cool, 199 00:07:59,203 --> 00:08:01,970 ‫because it didn't deploy a code that failed a test. 200 00:08:01,970 --> 00:08:04,339 ‫So if you look at the details of why it has failed, 201 00:08:04,339 --> 00:08:06,023 ‫and I click on this link. 202 00:08:06,023 --> 00:08:11,023 ‫If I have a look and look at the build log all the way down, 203 00:08:11,470 --> 00:08:14,690 ‫we can see that it was running a test and a test did fail. 204 00:08:14,690 --> 00:08:16,770 ‫And it was looking at whether "Hello World Stephane," 205 00:08:16,770 --> 00:08:19,360 ‫which is a new thing I changed, was equal to "Hello World." 206 00:08:19,360 --> 00:08:21,860 ‫And it wasn't the case, so it failed. 207 00:08:21,860 --> 00:08:23,470 ‫So let's go ahead and fix that. 208 00:08:23,470 --> 00:08:25,450 ‫So again, we can go into Cloud9. 209 00:08:25,450 --> 00:08:27,580 ‫I'm going to remove the "Stephane" 210 00:08:27,580 --> 00:08:29,250 ‫and go back to "Hello World." 211 00:08:29,250 --> 00:08:33,020 ‫But I'm just going to add "Additional Outputs" right here. 212 00:08:33,020 --> 00:08:35,590 ‫And I'm just going to put my name, Stephane. 213 00:08:35,590 --> 00:08:37,470 ‫And this should be good to go now. 214 00:08:37,470 --> 00:08:40,780 ‫So I'm just going to have single brackets just in case. 215 00:08:40,780 --> 00:08:43,060 ‫Okay, so this is working. 216 00:08:43,060 --> 00:08:44,490 ‫I'm going to save my file. 217 00:08:44,490 --> 00:08:48,350 ‫So my application, the py file, is saved. 218 00:08:48,350 --> 00:08:50,850 ‫And if we go into my Git project. 219 00:08:50,850 --> 00:08:52,750 ‫As you can see the changes are being detected, 220 00:08:52,750 --> 00:08:54,310 ‫so I'm going to add it. 221 00:08:54,310 --> 00:08:57,300 ‫I'm going to call it "fix application." 222 00:08:57,300 --> 00:08:58,150 ‫Okay, we're good to go. 223 00:08:58,150 --> 00:09:00,410 ‫Control, command, enter. 224 00:09:00,410 --> 00:09:03,563 ‫And then I'm going to do git push yet again. 225 00:09:04,670 --> 00:09:08,200 ‫So you're seeing the real workflow of a developer. 226 00:09:08,200 --> 00:09:10,810 ‫And this is something that is really dug deep 227 00:09:10,810 --> 00:09:15,090 ‫into the AWS certified developer certification. 228 00:09:15,090 --> 00:09:18,143 ‫So yet again, let's refresh this page and see what happens. 229 00:09:20,500 --> 00:09:22,990 ‫So my application source has just been committed right now. 230 00:09:22,990 --> 00:09:23,823 ‫It's in progress. 231 00:09:23,823 --> 00:09:25,700 ‫And so once this is done, we're going to go 232 00:09:25,700 --> 00:09:28,100 ‫into the build phase, and the build should work. 233 00:09:29,360 --> 00:09:31,390 ‫Okay, so my application has now been deployed. 234 00:09:31,390 --> 00:09:33,870 ‫And so if I click on "View application", 235 00:09:33,870 --> 00:09:35,410 ‫Now we can see the output is "hello world," 236 00:09:35,410 --> 00:09:37,530 ‫and the additional output is "Stephane". 237 00:09:37,530 --> 00:09:38,363 ‫So this has worked. 238 00:09:38,363 --> 00:09:40,860 ‫So it really shows you the end-to-end workflow 239 00:09:40,860 --> 00:09:43,190 ‫of a developer within AWS. 240 00:09:43,190 --> 00:09:45,230 ‫Now I'm just going to shut down everything. 241 00:09:45,230 --> 00:09:50,230 ‫So for IDE into Cloud9, I'm going to delete my environment. 242 00:09:50,410 --> 00:09:53,480 ‫So I'm just going to type "delete" in this field 243 00:09:53,480 --> 00:09:55,070 ‫to be done with it. 244 00:09:55,070 --> 00:09:57,320 ‫And then once this is deleted, 245 00:09:57,320 --> 00:10:00,260 ‫I'm going to go into my projects, 246 00:10:00,260 --> 00:10:04,163 ‫into my CodeStar projects at the top level. 247 00:10:05,530 --> 00:10:07,610 ‫And I'm going to delete this as well, 248 00:10:07,610 --> 00:10:09,934 ‫so I'll click on "Delete" to delete the resources 249 00:10:09,934 --> 00:10:11,200 ‫when I'm done. 250 00:10:11,200 --> 00:10:12,050 ‫So that's it. 251 00:10:12,050 --> 00:10:14,863 ‫I hope you liked it and I will see you in the next lecture.