This transcription provides a deep dive into Amazon EC2, covering its core concepts, instance types, purchasing options, lifecycle, user data, and EBS volumes. EC2 offers elastic, pay-as-you-go compute, with instance types named by family (e.g., C for compute-optimized), generation, and size. Key families include General Purpose (T for burstable, M for balanced), Compute Optimized (C for CPU-intensive), Memory Optimized (R, X), Storage Optimized (I, D), and Accelerated Computing (P, G, F for GPUs). For exams, a decision framework helps choose the right type: M for unknown, T for burstable, C for CPU, R for memory, I for storage, and P/G/F for GPUs. Purchasing options range from On-Demand (expensive) to Reserved Instances (up to 72% discount for steady workloads), Savings Plans (flexible), Spot Instances (up to 90% discount but interruptible), Dedicated Hosts (for licensing), and Dedicated Instances (for isolation). The instance lifecycle includes pending, running (billing starts), stopped (compute billing stops, but EBS and Elastic IPs continue), and terminated (billing stops). Reboot preserves everything; stop changes public IP; terminate deletes all. User data bootstraps scripts at first boot. EBS volumes are persistent network storage with six types: GP3 (default), GP2 (older), IO2 (max performance), IO1 (older), ST1 (sequential throughput), and SC1 (cheapest). HDDs cannot boot. Snapshots are incremental backups in S3, enabling cross-region copies and fast snapshot restore for immediate performance. Real-world examples, like Zoom's scaling and cost-saving strategies, illustrate practical applications.
Hey everyone, Balu here. Welcome back to Tech Talk with Balu. Today we're diving deep into Amazon EC2 and I mean deep. We're not just crouching the surface, we're going to understand the anatomy, the architecture and most importantly the economics of EC2. So if you're preparing for the AWS Solutions Architect exam, then this video is gold. I'm going to give you real world examples that will make these concepts stick. So grab a coffee and let's get started. Alright, let's start with the basics. What is EC2? EC2 stands for Elastic Compute Cloud. Now I know Amazon loves their fancy acronyms, but let me break this down in simple terms. Elastic means it can grow and shrink based on what you need. Compute means processing power, your CPU, your RAM, your storage and cloud means it's all running on virtual servers in AWS data centers around the world. Think about this way. In the old days, if you want to server, you have to buy one. That means spending tens of thousands of dollars, maybe hundred thousand dollars, waiting four to eight weeks for delivery, installing it, configuring it and then watching it sit there, using only 20% of its capacity most of the time. What a waste, right? With EC2, you click a button and 60 seconds later you've got a server. You need more service? Click again. You don't need them anymore. Shut them down. You only pay for what you actually use. Let me give you a real world example. Remember zoom during the pandemic? In March 2020, they had about 10 million daily users. By April, they had 300 million daily users. That's 30 times growth in just a few weeks. So there's no way they could have done that with just physical service, but with EC2, they just scaled up automatically. That's the power of elasticity. For the exam, remember these key points. EC2 gives you resizable compute capacity. It's pay as you go pricing. You get complete control over instance. We are talking root access here and it's available in over 30 regions worldwide. Now let's look at the instance types. Now this is absolutely critical for the exam. You will definitely get questions about choosing the right instance types. I promise you. First, let's understand how AWS names these things. Take C5NXLodge for an example. The C here is the instance family. In this case, it's compute optimized. The five is the generation number. Higher is newer and usually better. And the N is just an additional attribute. Here it just means that it's network optimized and XLodge is the size. Think of it like a car. Toyota is the manufacturer. Camry is the model. And XLE is the trim level. Same idea here. Now there are five major instant families that you will need to know for your exam. The first general purpose, that's your TM and a families. The T family is what we call burstable. These instances earn CPU credits when they are idle and spend those credits when they are busy. Imagine you're running a blog. Most of the day you've got 100 visitors an hour. No big deal. But then you write something that goes viral suddenly and then you've got 10,000 visitors or so an hour. A T3 instance accumulates credits during those quiet periods and then you could use them to burst up to full CPU during that viral traffic spike. Pretty smart, right? But here's the exam drop. Don't use the instances for sustained high CPU workloads. If you run at high CPU all the time, you will deplete your credits and you'll be stuck at baseline performance. The M family here is balanced. It's got one to four ratio of CPU to RAM. These are your general purpose workhoses. Think enterprise application servers, mall databases, that kind of thing. When in doubt, M is usually a safe choice. The second one, compute optimized, the C family. These are all about CPU power. They've got the highest performance process AWS office. The ratio here is one to two, one CPU to two gigs of RAM. A real world example would be video encoding. Let's say you need to transcode 10,000 videos every day. Each video needs very heavy CPU processing but not much of memory. A C518X large will process those videos twice as fast as an M5 at about the same cost. That's the power of using the right instance type. For the exam when you see words like CPU intensive, batch processing or high performance computing, just think it's the C family. The third is the memory optimized R and X families. These have a high ratio of memory to CPU one to eight or even higher. The X family can go up to four terabytes of RAM, four terabytes in a single instance. Let me give you two examples. First of red is cash cluster. You're running an e-commerce site and you want to cache your entire product catalog in memory, maybe five million products. You had used an R5X large with 32 gigs of RAM. Second example, maybe an SAP system. This is an in memory database that might need two terabytes of data in RAM, quile an X instance with three terabytes of RAM. So exam keywords, if they talk about in memory, cash or large data set memory, then think R or X family. Before this storage optimized, that is I and D families. The I family uses an NVMS ST super fast solid state tries that is they can deliver like absolutely insane performance. You'd use this for things like no SQL databases like Sandra that did massive random read write performance and the D family uses regular hard drives, but gives you a massive capacity. A D three instance, for example, can have 336 terabytes of storage. That's for things like data warehouses and distributed file systems, so and so forth. Then we have the accelerated computing. That's the PG and I and F families. These have GPUs, graphic processing units for parallel processing. Be instances of a machine learning training, training a deep learning model on CPUs that might take weeks on a P for instances with eight Nvidia 800 GPUs, maybe just two days. G instances are for graphics and machine learning inference. Think like game streaming video encoding that kind of thing. I have instances use AWS's custom in first chips and they're optimized specifically for inference running predictions, not training models. So here's your decision framework I want to you to use for your exam. If the question talks about a balance workload or an unknown workload, think M family. If it mentions variable CPU or burstable, then think about T family. If it's CPU intensive, then it's definitely C family. If it's memory intensive or in memory, think our family. If it needs high storage, think I family. If it needs GPUs, think PG or I in a families. So write that down. You will definitely need it. Alright, so now we are getting into the money stuff, the purchasing options. This is where companies can save millions of dollars and it's heavily tested on the exams you better listen to this. There are six ways to pay for EC2. Let me walk you through each one of them. Number one, there is on demand instance. This is the simplest. Basically you pay by the second for Linux or by the hour for Windows. No commitment, no upfront payment. You can start and stop whenever you want. But it's also the most expensive option. So when will you use this? Development, testing, proof of concept, short term workload, situations where you don't know your traffic patterns yet. Here's a key for the exam though. On demand is almost never the answer when they ask for the most cost effective solution. It's the default but it's rarely optimal. Number two, reserved instances. Now this is where the saving happens. You can get up to 72% discount compared to on demand, 72%. So how does it work? You commit to using an instance for one year or three years. In return, AWS gives you a massive discount. There are two types of reserved instances. Standard reserved instances give you the biggest discount but you can't change the instance family. You can modify the size or the availability zone but you're logged into that family. Convertible reserved instances. Convertible reserved instances give you a slightly smaller discount about 66%. But you can change the instance family. So that's a good thing. So if a newer generation comes out, you can convert your reservation. You also get to choose how you pay. All upfront gives you the biggest discount. Partial upfront is somewhere in the middle and no upfront gives you the smallest discount but you pay monthly. Let me show you the map. An M5 X large for three years on demand cost about 5,046 dollars. The same thing as a three year standard reserve instance, 2884 dollars. That's a saving of over 2000 dollars or 43%. When do you use reserved instance? So steady state workloads, predictable usage, production database that run 24/7. So for the exam, when you see keywords like steady state, predictable or 24/7, the answer is always reserved instance. So number three, savings plan. Think of this as a reserved instance version too. It's more flexible. With a compute savings plan, you commit to spending a certain amount per hour, let's say, $10 an hour and that commitment applies to EC2, Fargate and even Lambda. You can use any instance family, any region, any operating system. With an EC2 instance saving plan, you're locked to an instance [BLANK_AUDIO]
family in a specific region, but you get a slightly higher discount. Saving plans are AWS's newer recommendation. They are more flexible than reserved instances. So number four, sport instances. This is the big one. Up to 90% discount, 90%. Here's how it works. So AWS has spare capacity, servers that aren't being used. You can bid on that capacity at a huge discount, but there's a catch. AWS can take that capacity back with only a two minute warning. When is this perfect? Batch processing jobs, maybe data analysis, CI/CD DevOps, pipelines, anything that's fault-told and can handle interruption. When should you never use sport instances? So things like databases, critical web servers, is anything that can't be interrupted. You don't want to use sport instances for it. A real-world example? Let's say for example, you need to process one million images. An on-demand instance that cost $100. On sport, you would just pay $10. You save $90. For the exam, when you see can be interrupted and any mention of most cost effective, the answer is sport instance. Number five, dedicated hosts. This is where you can get an entire physical server dedicated to you. Why would you want this? Software licensing. Some software like Oracle or SQL Server is licensed per physical socket or per physical core. You need a dedicated host to comply with those licensing requirements. This is the most expensive option, but sometimes you have no choice. So exam keywords you want to look out for is licensing requirements, then kind of, you know, it should be a dedicated host. Let's get a number six, which is dedicated instances. Similar to dedicated hosts, but you can't control the physical server. AWS isolates your instances on dedicated hardware, but you can't use it for licensing. This is for compliance requirements where you just need physical isolation. So let me give you some exam practice questions here. Question one, a company runs a database 24/7 with predictable load. What is the most cost effective? The answer is reserved instances. You want it to be reserved because it's a database. It's run 24/7. It is non-intruptible at this point in time. Question two, nightly bash jobs that can be interrupted. Most cost effective, pot instances, that's right. So it will be spot instances because, of course, it can be interrupted. And also the question asks if it's cost effective. Yes, pot instances are cost effective. Question three, Oracle licensing, tied to a physical core. What are the options where you want to use a dedicated host? Because like we said, any licensing that you want to actually then tie to a physical core, that's where you go and use a dedicated host. See how the keywords point you to the answer? That's what you need to watch out for the exam. Now we're going to an interesting bit just to understand about the lifecycle of the instances. This is important because different states have different billing implications so watch out. So when you launch an instance, it goes through several states. First, it's pending. AWS is finding a hardware for you, allocating resources, setting up networking. This usually takes 30 to 90 seconds and you're not billed yet. Then it goes to running. The instance is fully operational. You can connect to it and this is when the billing starts. The moment it hits running, you're paying for it. You can reboot an instance. This is just like restarting your computer. Everything is preserved. Your instance ID, your private IP, your public IP, even your instance store data. And you're still being billed continuously. You can stop an instance. This shuts it down. Now here's what's important. When an instance is stopped, you're not billed for the instance computer. It's because it now it's turned off. But you're still billed for the eBus volumes attached to it and you're still bill for any elastic IPs. This is very important. And here's what stays and what goes. Your instance ID stays, your private IP stays, your elastic IP stays, your eBus volume stay, but your public IP changes. And the instance store data is gone. Let me show you the cost saving. A running M5 large cost about $70 a month, for instance, plus maybe $10 for EBS, that's $80 in total. A stopped M5 large costs zero for the instance because you've stopped it, but you still pay $10 for EBS. So you can save $70 a month or 87%. This is huge for dev and test environments. So stop them overnight and on weekends and save a ton of money. Finally, you can terminate an instance. This permanently deletes it. The instance ID is gone forever. The instance store is gone. The eBus root volume is deleted by default. Though you can configure it to persist in some instances and the billing stops completely. Now here's a critical example you need to memorize. So when you reboot instance ID stays, private IP stays, public IP stays, elastic IP stays, instant store data stays, everything stays. When you stop, instant ID stays, private IP stays, but public IP changes. Elastic IP stays, instant store data is lost. When you terminate, everything is gone. So an exam trap question, let's say, would be an admin stops an instance Friday evening and starts at Monday morning. What changes? The answer is public IP address changes. The instance ID and the private IP stay the same. This comes up by the way all the time in the exam. So I want you to memorize that. So real quick, let's talk about what user data is and what the purpose of user data is in an EC2 instance. So EC2 user data is basically a script that is bootstrapped. In the instance, as you boot up, it's run only once at first boot. It runs at root privilege. Some of the use cases are, let's say, for example, if you want to install updates, downloads at and files that you need as your EC2 instance runs, anything, any action that you want to do as your EC2 instance boots up, this is where you kind of have this user data configuration file. So next, let's dive into what EBS volume is or it's called elastic block store. Think of it as a network attached hard drive for your EC2 instance. Its key characteristics are its persistent. So data survives when you stop or terminate the instance as long as you configure it in that way. It's network attached. So there is a tiny bit of latency compared to directly attached storage. It's automatically replicated within its availability zone to protect against hardware failure. So if an availability zone goes down, you would still get protected by some sort of redundancy. And you can attach and detach volumes from your instances. Now, there are six type of EBS volumes and you must absolutely know these for your exams. First type is GP3, channel purpose SSD. This is the latest generation. So every GP3 volume, no matter what the size is, gets a baseline of 3000 IOPS, which is input output per second. You will hear a lot of IOPS, the higher the IOPS, the more the amount of operations that you could perform on it. Now, this is your default choice for most workloads. So boot volumes, development, testing, small to medium databases, and so on and so forth. There is GP2, which is also a general purpose SSD. It's the older generation. It's actually more expensive than GP3. So for new deployments, you always want to choose GP3. You have the third type, which is IOPS block express. This is what you need for maximum performance. We are talking about some millisecond latency here. It's expensive, but when you do need absolute maximum performance for mission critical databases, this is what you want to use. A real world example would be a financial training platform database that processes millions of transactions per second. They will need an IOPS block express. For the exam, when you do see things like mission critical, maximum IOPS, or anything over 16,000 IOPS, the answer is always I02. The fourth type is I01. That's the previous generation of the provisioned IOPS. It's same price as I02, but I02 has better durability. So always choose I02 over the older I01. Now, let's move into hard drive options. These cannot be used as boot volumes. That's a key exam point. SD1. That's the throughput optimized HDD. This is optimized for sequential throughput, not random IOPS. It costs half the price of GP3, when do you use this kind of thing? So for big data workloads, data warehouses, log processing, anything that reads and writes data sequentially, you want to use the SD1. The sixth type is SC1, which is called HDD. This is the cheapest option. You can use this for infrequently access data, like archives, compliance data, that you need to keep but rarely accessed. So here is your key decision tree. First question. Do you need to boot from it? If yes, you must use SSD. GP3, GP2, IOP1, or IOP2. HDDs cannot be boot volumes to remember that. Second question. What are your performance needs? If you need high performance, then you want to use IOP2. If not, you could use GP3. If you need sequential throughput and want to save money, use SD1. If it's for infrequent access and you want the absolute lowest cost, then you want to use SC1. So let me give you an exam scenario. A database requires 50,000 sustained IOPS, which EBS type you want to use. The answer is IOP2 block express. It's the only option that can deliver over 16,000 IOPS. Remember that number.
16,000 IOPS. Another question could be most cost-effective storage for 10 terabytes of archive data that's accessed once in a month. Remember that's SC1 called HDD. Another question, there is a big data application that needs to process logs sequentially with high throughput cost-effective solution. The answer there is SD1, throughput-optimized HDD. The question could be can you use SD1 as a boot volume? Nope, only SSDs can be used as boot volumes. This stuff shows up constantly on the exam, so do remember that. Now let's talk about eBS snapshots and encryption. These are point in time backups of your eBS volumes and they are stored in the S3 itself. The key thing to understand is that snapshots are incremental. The first snapshot copies all the data, let's say, for instance 80 gigs. The second snapshot only then copies what's changed, maybe 5 gigs. So you're only charged for 85 gigabytes, total, not 160. This saves you time, bandwidth and money. You can copy snapshots across regions for disaster recovery, you can create new volumes from snapshots, you can create AMIs, Amazon machine images from snapshots, and then you can share snapshots with other AWS accounts. There's also something called fast snapshot restore. Normally, when you create a volume from a snapshot, the first access to each block has some latency because the data has been pulled from S3. Fast snapshot restore preloads all the data so you get full performance immediately. It costs extra, but it's worth it for production databases. Now, let's talk encryption. EBS encryption uses AWS KMS, key management service. The data is encrypted at rest on the volume and in transit between EC2 and EBS. It's completely transparent to your applications. They see unencrypted data and there is minimal performance impact less than one person. So if you encrypt a volume, the snapshots are automatically encrypted too. If you create a volume from an encrypted snapshot, that volume is encrypted too. Now here is an important exam question. How do you encrypt an existing unencrypted EBS volume? The answer is you can't do it directly. You have to first create a snapshot, copy the snapshot with encryption enabled, and create new encrypted volume from that snapshot, and then attach it to your instance. A long round way. So the best practice is to enable encryption by default at the account level this way. Every new EBS volume that you create is automatically encrypted. So now let's look at what instance stores are. This is completely different to EBS. Instant store is physically attached storage, so actual disk drives on physical server. It's ephemeral, which means temporary. It's included in the instance price. And it has very high performance because there is no network involved, like the EBS. Here's a critical thing you need to understand for the exam. Instance to data is lost when you stop the instance, when you terminate the instance, or when the underlying hardware fails. The only time instant store data is kept is when you reboot the instance. Let me repeat that because it's a common exam trap. Reboot keeps the instant store data. Stopping or terminating that instance loses that data. The performance is incredible though. An i316x large has 15 terabytes of local NVM SSD storage and can deliver 3.3 million IOPS within micro second latency. Now you can't get that performance with EBS. Now when do you use instant store? So caching like redis cache, where the data can be rebuilt. You could use that for temporary processing like video encoding, where you download the file process, it upload the data and delete the local copy. It distributes a databases with replication like Cassandra, where the data is replicated across multiple nodes. So if one node loses its instant store, the data is still on the other node. So common exam trap question could be that, for example, an administrator stops an EC2 instance that has an instant store volume. What happens to that data? Yeah, the answer is but luck, the data is lost. Now this is asked constantly on the exam in different ways. Now next, let's talk about Amazon machine images and AMI. It's like a template for launching EC2 instances. It contains the root volume, the launch permissions and the block device mapping. There are four types of AMIs. AWS provides AMIs like Amazon Linux, Ubuntu, Windows Server. These are free and maintained by AWS or their partners. Marketplace AMIs have third parties offered, pre-installed like WordPress or MongoDB. These might have additional licensing fee. Community AMIs are shared by other AWS users. So tip, use these carefully, they're not verified by AWS. And custom AMIs, which you create yourself. This is what you will normally use in production. So why create a custom AMI? Instead of launching an instance and then spending time installing Apache, PHP, your application code, configuring everything, what you want to do is to configure it once, create an AMI and then every new instance launches with everything already installed. It's faster, it's consistent and it's how you enable auto scaling. AMIs are regional resources important. When AMI in US East 1 region is not available in US West 2, what you'll have to is copy it to the other region. For disaster recovery, you add copy operation AMIs to another region. Then if your primary region goes down, you can quickly launch instances in the backup region. AMIs are critical for auto scaling. Your launch templates specify which AMI to use. When auto scaling launches new instances, they come from that AMI so they're already configured and ready to serve traffic immediately. So few exam questions. A company needs to launch 100 web servers with identical configuration. What's the best approach? The answer is configure one instance, create an AMI from it, then launch 100 instances from that AMI. Another common question is an application in US East 1 needs disaster recovery in EU West 1. What should you do with the AMI? Answer is copy the AMI to EU West 1. Now let's delve into security groups. Security groups are virtual firewalls for your EC2 instances. This is one of the most tested topics on the exam. Key characteristics. Security groups are stateful. If you allow traffic in, the response is automatically allowed out. Remember that. They only have allowed rules. You cannot create deny rules for them. And by default, all in bone traffic is denied. All out bone traffic is allowed. Let me explain stateful with an example. You create a rule that allow SSH inbound on port 22 from your IP address. When you SSH in to the instance, the inbound connection is checked against the rule and allowed. The response traffic going back to you automatically allowed. You don't need an outbound rule for it. Now compare that with network ACLs which are stateless. With network ACLs, you have to explicitly allow both inbound traffic and the outbound response. Security groups are much simpler compared to that. Now, let me show you a real world 3 tier architecture. You've got a load balancer in the front. It's a security group allows HTTP and HTTPS from anywhere on the internet. That 0.0.0.0/0. Behind that, you've got your web service. The security group allows HTTP only from load balancer security group, not from the internet, only from the load balancer. And it allows SSH only from a bastion host security group for administrative access. Behind that, you've got your database. Security group allows mySQL port 3306 only from the web server security group. Again, not from the internet, not even from the load balancer, only from the web servers. This is called defense in depth. The public cannot directly reach a web service. The web servers can only be accessed through your load balancer. The database can only be accessed from the web service. It's a layered security. Now notice how I'm referencing security groups and not IP addresses. Instead of saying allow port 3306 from 10.0.1.5, I'm saying allow port 3306 from the web server SD security group. Why? Because instances come and go. The IP addresses change. But the security group reference stays valid. In instance, that's a member of a web server SD can connect to the database. It's much more maintainable that way. Some best practices use the principle of least privilege. Never open databases to 0.0.0/0, which is allow all. Use security group references instant of IP addresses. Use a clear naming convention like environment, tier, purpose, SG and document each rule with a description. Now here are some critical examples. One of the questions is can you block a specific IP address with a security group? Answer is no. Security groups only have allow rules. You need to use network asheals to block specific IPs. Another question is what's the difference between security groups and network asheals? The answer is security groups are stateful and operate at the instance level with allow rules only. Network asheals are stateless, operated subnet level and support both allow and dener rules. Do security group changes require an instance restart? The answer is no. Changes take effect immediately. These kind of questions come up over and over in the exam. Now let's now look at what placement groups are. Online groups let you control where AWS physically places your instances. There are three types and they.
each solve different problems and have different use cases. Type 1. Cluster Placement Group This packs all your instances close together in a single availability zone, often in the same rock. Now, why would you do this? For performance. You get the lowest possible network latency we are talking microseconds here. You get up to 10 gigabits per second between instances or even higher with newer instance types. When do you use this? High performance computing. In learning training, tightly coupled applications that need constant communication between nodes. Now, what's the downside? It's a single point of failure. If that rock goes down or if that availability zone has an outage, all your instances are affected together. For the exam, keywords like lowest latency, HPC or tightly coupled point to cluster placement group. Type 2. Spread Placement Group This does the opposite. It places each instance on different underlying hardware, different racks, different network switches, different power sources. Now, why would you do that? To get maximum isolation. You want to make absolutely sure that a hardware failure doesn't take down multiple instances at once. There is no limitation. You can only have seven instances per availability zone in a spread placement group. That's it. Seven. Now, when would you use this? You would use this for critical applications. A small number of instances that absolutely cannot fail together. Think core bagging systems, critical infrastructure, etc. For the exam, keywords like critical instances or avoid correlated failures mean spread placement group. And remember that number. Seven instances max per azy. They're love to test that. Type 3. Partition Placement Group Now this is a hybrid approach. To divide your instances into logical partitions and each partition is placed on a separate rack, you can have up to seven partitions per availability zone, but each partition can have many instances. Now, why would you use this? Large distributed systems. Addube, Cassandra, Kafka. These systems are designed to replicate data across nodes. By putting different nodes in different partitions, you ensure that a rack failure only affects one partition not the whole cluster. For example, you've got a hundred node Cassandra cluster. You create five partitions with 20 nodes each. Now if one rack fails, you lose 20 nodes, one partition that is. But the other 80 nodes keep running and Cassandra can eventually recover. Let me give you a comparison. Cluster is for performance that is lowest latency, single azy, hundreds of instances, but single point of failure. Spread is for maximum availability. Partitions on different hardware, multiple azy, but limited to seven instances per azy. Partition is for large distributed systems. Partition level isolation, multiple azy, hundreds of instances total. Now let's look at some of the exam questions. NHPC application requires the lowest possible network latency. What placement strategy would you use? The answer is cluster placement group. Another question. A company runs four critical database instances that must not fail together. What placement group would you use? You would use Pratt placement group. Another question. A hundred and fifty node had to cluster needs partition level fault isolation. You would use partition placement group. Next we are looking into cloud watch monitoring. By default every easy to instance gets basic monitoring. This gives you metrics every five minutes and it's absolutely free. You get CPU utilization network traffic, disk operation, status checks and so on. If you enable detail monitoring you get metrics every one minute, instead of every five. Now this costs money, but it's useful for auto scaling. It can respond faster to changes. Now here's something really important for the exam. Some metrics are not available by default. Memory utilization not there. The space usage not there. You have to install cloud watch agent to get those metrics. So if the exam asks how can an administrator monitor memory usage? The answer is install the cloud watch agent and configure custom metrics. You can set up cloud watch alarms to notify you when the metrics cross thresholds. High CPU, send and SNS notification. Status check failed. Automatically recover the instance. Low CPU for cost optimization. Maybe trigger a lambda function to stop the instance. Now there are two types of status checks. System status checks monitor the AWS infrastructure. If there is a loss of network connectivity or hardware issue, this check fails. The fix. When you stop and start the instance to move it to a different hardware or AWS fixes their infrastructure. Instant status checks monitor your software and operating system. If you have a corrupted file system or a misconfigured network, this check fails. What's the fix? You have to troubleshoot and fix it yourself. Reboot the instance or fix the configuration of whatever is needed. Now AWS system manager is also really important. Session manager lets you connect to the instances without SSH. You don't need a bastion host. You don't even need the instance to have a public IP address. It's all managed through the console or CLI and it's fully audited. For the exam, if they ask you about connecting to instances in private subnets without a bastion host, the answer is session manager. Run command lets you execute commands across multiple instances without SSH. Patch manager automates patching, parameter stores stores configuration secrets. These features come a lot on the exam, so make sure you're familiar with systems manager. So now let's recap, we're coming to the end of the video. As an exam strategy, let's talk about how to tackle easy to questions on the exam. The exam loves patterns. Once you recognize the pattern, the answer becomes obvious. Pattern 1 choosing instance types. Look for keywords, CPU intensive or batch processing that refers to the C family. In memory or large data set in memory, then go for the R family. Buy a OPS or no SQL database, then it's the I family. Variable workload or burstable, then that's a T family. Machine learning training or GPU, then it's typically the P or the G family. The second pattern is cost optimization. Steady state or 24/7 or predictable, then that means you want to use reserved instances or savings plans. If it can be interrupted or fault tolerant, then go for spot instances. If you require licensing requirements, then you want to use dedicated hosts. If it's used for development or testing or short term, then you want to go on demand. Pattern 3 high availability. They will ask you to design a highly available architecture. The answer always includes multi-AZ deployment at least two availability zones. Autoscaling group to automatically replace failed instances. Load balancer to distribute traffic, health checks to detect failures. Then for storage selection, they talk about persistent or data must survive, then it's the EBS that you want to go for. If you want temporary or some sort of caching, then it's the instance store. If it's a shared across instances, then you want EFS. If you want over 16,000 IOPs remember it's the IO2. If you want sequential throughput or big data, then it's SD1. If you want infrequent access or lowest cost, then it's SC1. 75 security. Instance level firewall or stateful, then you want to say security groups cover it. Subnet level or block specific IP, then it's the network ACLs. Cannot deny with security groups, true, use NACLs instead. General exam tips. First identify the constraint and here are some common traps. Can security groups block specific IPs? The answer is no. Does rebooting lose instance store data? No. Only stop and terminate do. Maximum spread placement group instance is parasy. That's seven. And can SD1 be a bootable volume? No. Memorize these specifically, they do come constantly. Alright, everyone. We have covered a ton today. Let me quickly recap the key points for you to remember. Easy to give you virtual service in the cloud with pay as you go pricing. You can scale elastically from one instance to thousands. Instance types remember the families. T is for burstable, M for general purpose, C for compute, alpha memory, I for storage, P and G for GPUs. With regards to pricing, on demand is the default but rarely optimal. Reserved instances save 72% for steady state. Sport saves 90% for fault tolerant workloads. With regards to instance lifecycle, reboot keeps everything including the instance store. Stop loses public IP and instance store terminate loses everything. With regards to EBS volumes, GP3 is your default choice. IO2 for over 16,000 IOPS SD1 for sequential throughput, SE1 for lowest cost. Remember, HDD volumes cannot boot volumes. Instance store is temporary but very fast, data is lost on stop or terminate, kept only on reboot. AMIs are your deployment templates, create custom AMIs with your software preinstalled. Security groups are stateful firewalls, with allow rules only. Use them at the instance level. Network ACLs are stateless and work at the subnet level. Placement groups cluster for low latencies, platform max isolation with 7 instances max per AZ partition for large distributed systems. Monitor with cloud watch, install the agent for memory metrics. Use systems manager session manager instead of busting hosts. For the exam watcher keywords, they point you directly to the
answer. Practice identifying patterns. Okay that's it for today. If this was helpful please hit that like button and subscribe for more AWS content. Drop any questions in the comments and I read every single one. With that we wind up and we will come back with another deep dive on other AWS topics until then keep studying, keep practicing and good luck on your exam. This is Baloo Sign-Off. See you in the next one.
Podcast Summary
Key Points:
EC2 (Elastic Compute Cloud) provides resizable, pay-as-you-go virtual servers in AWS data centers, enabling rapid scaling (e.g., Zoom's pandemic growth from 10M to 300M users).
Instance types are named by family (e.g., C for compute-optimized), generation, attributes, and size; major families include General Purpose (T, M), Compute Optimized (C), Memory Optimized (R, X), Storage Optimized (I, D), and Accelerated Computing (P, G, F).
Decision framework
Six purchasing options
Instance lifecycle
User data is a bootstrapping script run once at first boot with root privileges for installing updates or downloading files.
EBS volumes are persistent, network-attached storage with six types
EBS snapshots are incremental backups stored in S3, supporting cross-region copying, volume creation, AMI creation, and fast snapshot restore for immediate performance.
Summary:
This transcription provides a deep dive into Amazon EC2, covering its core concepts, instance types, purchasing options, lifecycle, user data, and EBS volumes. , C for compute-optimized), generation, and size. Key families include General Purpose (T for burstable, M for balanced), Compute Optimized (C for CPU-intensive), Memory Optimized (R, X), Storage Optimized (I, D), and Accelerated Computing (P, G, F for GPUs).
For exams, a decision framework helps choose the right type: M for unknown, T for burstable, C for CPU, R for memory, I for storage, and P/G/F for GPUs. Purchasing options range from On-Demand (expensive) to Reserved Instances (up to 72% discount for steady workloads), Savings Plans (flexible), Spot Instances (up to 90% discount but interruptible), Dedicated Hosts (for licensing), and Dedicated Instances (for isolation). The instance lifecycle includes pending, running (billing starts), stopped (compute billing stops, but EBS and Elastic IPs continue), and terminated (billing stops).
Reboot preserves everything; stop changes public IP; terminate deletes all. User data bootstraps scripts at first boot. EBS volumes are persistent network storage with six types: GP3 (default), GP2 (older), IO2 (max performance), IO1 (older), ST1 (sequential throughput), and SC1 (cheapest).
HDDs cannot boot. Snapshots are incremental backups in S3, enabling cross-region copies and fast snapshot restore for immediate performance. Real-world examples, like Zoom's scaling and cost-saving strategies, illustrate practical applications.
FAQs
EC2 stands for Elastic Compute Cloud. It provides resizable virtual servers in AWS data centers, allowing you to scale compute power up or down as needed and pay only for what you use.
The five major families are: general purpose (M and T families), compute optimized (C), memory optimized (R and X), storage optimized (I and D), and accelerated computing (P, G, and F families). Each is designed for specific workloads.
T3 instances are ideal for variable CPU workloads, like a blog with occasional traffic spikes. They accumulate CPU credits during idle periods and use them to burst during high demand, but avoid them for sustained high CPU workloads.
The options are On-Demand (pay per second/hour, no commitment), Reserved Instances (up to 72% discount for 1- or 3-year commitment), Savings Plans (flexible hourly spend commitment), Spot Instances (up to 90% discount, but can be interrupted), Dedicated Hosts (physical server for licensing), and Dedicated Instances (physical isolation).
Billing starts when the instance is running. When stopped, you are not billed for compute but still pay for attached EBS volumes and Elastic IPs. Terminating an instance stops all billing and deletes the instance.
Stopping shuts down the instance; the instance ID and private IP stay, but the public IP changes and instance store data is lost. Terminating permanently deletes the instance, and everything is gone.
Chat with AI
Loading...
Pro features
Go deeper with this episode
Unlock creator-grade tools that turn any transcript into show notes and subtitle files.