1 00:00:00,740 --> 00:00:02,560 - [Alana] Welcome to Exercise 1. 2 00:00:02,560 --> 00:00:05,330 In this exercise, you'll be using your own AWS accounts 3 00:00:05,330 --> 00:00:06,960 to create an EC2 instance 4 00:00:06,960 --> 00:00:09,360 that you later deploy to with CodeDeploy. 5 00:00:09,360 --> 00:00:10,890 If you don't have an AWS account, 6 00:00:10,890 --> 00:00:12,520 refer to the reading before this video 7 00:00:12,520 --> 00:00:15,610 called Create Your Own AWS Account. 8 00:00:15,610 --> 00:00:17,240 Here's how this will work. 9 00:00:17,240 --> 00:00:19,330 Your EC2 instance is what we'll refer 10 00:00:19,330 --> 00:00:21,380 to as your test environment. 11 00:00:21,380 --> 00:00:22,970 You'll be creating this. 12 00:00:22,970 --> 00:00:25,180 In Exercise 2, you will use CodeDeploy 13 00:00:25,180 --> 00:00:28,220 to eventually deploy code to this test environment. 14 00:00:28,220 --> 00:00:29,810 And that code will be stored 15 00:00:29,810 --> 00:00:33,300 in Amazon Simple Storage Service, or Amazon S3, 16 00:00:33,300 --> 00:00:35,570 which is an object storage service. 17 00:00:35,570 --> 00:00:37,840 Sounds simple enough, right? 18 00:00:37,840 --> 00:00:39,540 But there's a lot that needs to happen 19 00:00:39,540 --> 00:00:41,750 behind the scenes to make this work. 20 00:00:41,750 --> 00:00:42,650 For example, 21 00:00:42,650 --> 00:00:45,410 all of these services need to communicate with each other, 22 00:00:45,410 --> 00:00:46,790 and none of that communication 23 00:00:46,790 --> 00:00:49,620 is allowed or enabled by default. 24 00:00:49,620 --> 00:00:52,410 That means CodeDeploy needs to communicate with EC2, 25 00:00:52,410 --> 00:00:55,040 and EC2 needs to communicate with S3. 26 00:00:55,040 --> 00:00:57,173 And we have to set all of this up. 27 00:00:58,450 --> 00:01:00,650 To do this, We'll do a few things. 28 00:01:00,650 --> 00:01:01,741 The first is, we'll create 29 00:01:01,741 --> 00:01:03,750 AWS Identity and Access Management, 30 00:01:03,750 --> 00:01:08,010 or IAM roles for the services to enable communication. 31 00:01:08,010 --> 00:01:10,360 So, for EC2, we'll create an IAM role 32 00:01:10,360 --> 00:01:12,000 that has permissions to S3, 33 00:01:12,000 --> 00:01:14,880 and assign it to our instance when we create it. 34 00:01:14,880 --> 00:01:18,790 That will enable the EC2 instance to grab the code from S3. 35 00:01:18,790 --> 00:01:21,205 We'll also assign a policy that has permissions to 36 00:01:21,205 --> 00:01:23,380 AWS Systems Manager Session Manager, 37 00:01:23,380 --> 00:01:26,310 which will enable us to remotely connect to our instance 38 00:01:26,310 --> 00:01:29,090 without having to manage SSH keys. 39 00:01:29,090 --> 00:01:31,330 Then, we'll create a service role for CodeDeploy, 40 00:01:31,330 --> 00:01:34,098 which will allow CodeDeploy to call other AWS services, 41 00:01:34,098 --> 00:01:36,500 including Amazon EC2. 42 00:01:36,500 --> 00:01:38,050 So, that's great. 43 00:01:38,050 --> 00:01:39,810 Two roles that will enable communication 44 00:01:39,810 --> 00:01:41,700 to flow between the services. 45 00:01:41,700 --> 00:01:43,410 We're done, right? 46 00:01:43,410 --> 00:01:45,410 Well, not so fast. 47 00:01:45,410 --> 00:01:47,630 For CodeDeploy to communicate with EC2, 48 00:01:47,630 --> 00:01:49,830 we not only need a role, 49 00:01:49,830 --> 00:01:53,850 we also need to install the CodeDeploy agent on EC2 as well. 50 00:01:53,850 --> 00:01:54,920 So, in the lab, 51 00:01:54,920 --> 00:01:56,890 after you create your EC2 instance, 52 00:01:56,890 --> 00:01:58,760 or your test environment, 53 00:01:58,760 --> 00:02:01,670 you'll connect to your instance and install the agent. 54 00:02:01,670 --> 00:02:04,180 And that enables CodeDeploy to use this instance 55 00:02:04,180 --> 00:02:06,270 for future deployments. 56 00:02:06,270 --> 00:02:09,240 You'll also need to install the AWS Systems Manager agent 57 00:02:09,240 --> 00:02:10,600 on your instance as well, 58 00:02:10,600 --> 00:02:13,450 to ensure that you can remotely connect to your instance. 59 00:02:14,430 --> 00:02:16,068 So, what you'll be creating: roles, 60 00:02:16,068 --> 00:02:19,450 creating an instance, and connecting to that instance 61 00:02:19,450 --> 00:02:22,740 to deploy an agent, and all of this will be built upon 62 00:02:22,740 --> 00:02:24,160 in the second lab. 63 00:02:24,160 --> 00:02:25,940 If you have any questions, 64 00:02:25,940 --> 00:02:27,380 feel free to post in the forums 65 00:02:27,380 --> 00:02:29,140 and get help from one another. 66 00:02:29,140 --> 00:02:30,410 If you see a question in the forums 67 00:02:30,410 --> 00:02:31,580 that you know the answer to, 68 00:02:31,580 --> 00:02:33,850 I encourage you to respond to others. 69 00:02:33,850 --> 00:02:37,330 The instructors will also be monitoring the forums as well. 70 00:02:37,330 --> 00:02:39,753 All right, go ahead and get started.