1 00:00:06,590 --> 00:00:08,440 - Okay, so now let's talk about 2 00:00:08,440 --> 00:00:10,530 the Instance Metadata Service. 3 00:00:10,530 --> 00:00:14,520 The Instance Metadata Service is a very special 4 00:00:14,520 --> 00:00:17,500 URL available to us that we can query 5 00:00:17,500 --> 00:00:21,090 in order to get information about an EC2 instance, 6 00:00:21,090 --> 00:00:23,950 and that URL looks something like this, 7 00:00:23,950 --> 00:00:28,950 HTTP 169.254.169.254/latest/meta-data, 8 00:00:33,370 --> 00:00:36,140 and, of course, if we were to query that URL, 9 00:00:36,140 --> 00:00:40,070 we would get back a list of other URLs that we can reach, 10 00:00:40,070 --> 00:00:45,070 and what this does is that from within an EC2 instance, 11 00:00:45,990 --> 00:00:49,400 we can use this URL to retrieve 12 00:00:49,400 --> 00:00:51,713 information about that instance. 13 00:00:54,900 --> 00:00:56,440 An EC2 instance can use this 14 00:00:56,440 --> 00:00:59,500 to get information about itself. 15 00:00:59,500 --> 00:01:03,550 We cannot access this URL from outside an instance, 16 00:01:03,550 --> 00:01:08,550 and we cannot use this URL in order for one instance 17 00:01:08,700 --> 00:01:10,850 to get information about another. 18 00:01:10,850 --> 00:01:13,620 It's always so that one EC2 instance 19 00:01:13,620 --> 00:01:16,640 can get information about itself, 20 00:01:16,640 --> 00:01:18,360 and so this is very useful 21 00:01:18,360 --> 00:01:22,270 when it comes to bootstrapping EC2 instances 22 00:01:22,270 --> 00:01:26,500 or doing some type of programmatic response 23 00:01:26,500 --> 00:01:27,380 to the environment 24 00:01:27,380 --> 00:01:32,140 so that when a machine comes to life, it can go and find out 25 00:01:33,260 --> 00:01:35,450 what type of machine is it supposed to be? 26 00:01:35,450 --> 00:01:38,173 What type of job is it supposed to perform? 27 00:01:39,280 --> 00:01:41,193 What is my IP address? 28 00:01:42,084 --> 00:01:44,630 What type of volumes do I have attached? 29 00:01:44,630 --> 00:01:47,073 Those kinds of things are available, 30 00:01:49,440 --> 00:01:51,760 and so there's all kinds of information 31 00:01:51,760 --> 00:01:55,490 that we can retrieve through the Instance Metadata Service. 32 00:01:55,490 --> 00:01:58,480 We can retrieve the machine image ID. 33 00:01:58,480 --> 00:02:03,350 We can retrieve the DNS host name, the instance ID, 34 00:02:03,350 --> 00:02:07,033 the instance type, the private IP address, 35 00:02:08,070 --> 00:02:11,390 and of course, again, this is often used 36 00:02:11,390 --> 00:02:13,480 with different types of scripts 37 00:02:13,480 --> 00:02:16,370 for instance-specific configuration. 38 00:02:16,370 --> 00:02:21,170 So one of the really powerful and beautiful things about AWS 39 00:02:21,170 --> 00:02:23,150 is the level of automation, 40 00:02:23,150 --> 00:02:25,173 and as we will talk more about later, 41 00:02:26,390 --> 00:02:31,390 the only way to truly realize the power of AWS, 42 00:02:31,500 --> 00:02:34,710 the cost savings, the flexibility, the agility, 43 00:02:34,710 --> 00:02:37,520 is through leveraging automation, 44 00:02:37,520 --> 00:02:41,940 and this is one of the critical or key components 45 00:02:41,940 --> 00:02:43,680 to enabling automation, 46 00:02:43,680 --> 00:02:48,320 is when we have instances come to life through autoscaling 47 00:02:48,320 --> 00:02:49,770 which we'll talk about later, 48 00:02:51,080 --> 00:02:54,723 ideally, that instance is able to configure itself, 49 00:02:56,030 --> 00:02:58,100 ensure that whatever software is needed 50 00:02:58,100 --> 00:03:00,380 is installed, configured, 51 00:03:00,380 --> 00:03:03,070 and whatever processes are needed are running 52 00:03:03,070 --> 00:03:06,420 so that machine can come to life and get to work 53 00:03:06,420 --> 00:03:08,190 doing what it's supposed to do, 54 00:03:08,190 --> 00:03:09,860 and so the Instance Metadata Service 55 00:03:09,860 --> 00:03:12,920 provides a very rich API 56 00:03:12,920 --> 00:03:16,710 so that machine has all of the information 57 00:03:16,710 --> 00:03:19,670 that it could possibly need at its disposal 58 00:03:19,670 --> 00:03:22,350 in order to programmatically, 59 00:03:22,350 --> 00:03:24,440 essentially become what it's supposed to become 60 00:03:24,440 --> 00:03:26,660 and get to work doing what it's supposed to do, 61 00:03:26,660 --> 00:03:28,990 and so we will take a closer look 62 00:03:28,990 --> 00:03:32,633 at the Instance Metadata Service in upcoming lessons.