The Secret Life of AWS: The Empty Room
Part 3 of The Secret Life of AWS
Timothy walked into the main study of the West Wing, carrying a heavy stack of ledgers. He looked around for a place to set them down, but the room was completely bare.
"Margaret?" he called out. "Where are the computers? I thought we were building the new catalog system today."
Margaret was standing by a large, rolling chalkboard in the center of the room. She was wiping away a diagram of a steam engine.
"We are," she said, dusting chalk from her hands. "But in the Cloud, Timothy, you do not walk into a room and find a computer waiting for you. You must summon one into existence."
She picked up a fresh piece of chalk. "Put the ledgers down. Today we discuss EC2."
The Virtual Server (EC2)
Margaret drew a simple square box on the chalkboard.
"In the old days," she began, "if we needed a server, we had to order it, wait for delivery, rack it, and wire it up. It took weeks. EC2 stands for Elastic Compute Cloud. It allows us to rent a virtual server instantly."
"So it is not a real machine?" Timothy asked.
"It is a slice of a real machine," Margaret corrected. "Somewhere in an AWS data center, there is a massive physical server. AWS uses software to slice that giant server into smaller, virtual pieces. We rent one of those pieces."
She wrote INSTANCE inside the box.
"We call this an Instance. You can spin it up in seconds, use it for as long as you need, and then shut it down. You pay only for the seconds you use."
Instance Types (The Hardware Specs)
Timothy nodded. "Fine. I need an instance. Can I have one now?"
"Not yet," Margaret said. "You must tell me how powerful it needs to be."
She drew a chart next to the box.
- CPU (Brain Power)
- RAM (Short-term Memory)
"We call this the Instance Type," she explained. "AWS gives us a menu of combinations. You cannot just say 'I want a computer.' You must be specific."
"I just need to run a simple web server," Timothy said. "Nothing fancy."
"Then you would choose a General Purpose instance," Margaret said, writing t3.medium on the board. "Like the T-series or M-series. They have a balance of memory and processing power."
"What if I was calculating the trajectory of a comet?" Timothy asked.
"Then you would want a Compute Optimized instance," she replied. "The C-series. High processing power, less memory. Or, if you were sorting millions of library cards in memory, you would want a Memory Optimized R-series."
"It is like buying a suit," Timothy mused. "I must choose the fit before I put it on."
AMIs (The Operating System)
"Precisely," Margaret said. She tapped the box on the chalkboard. "Now, we have the hardware. But the hard drive is blank. What software should be on it?"
"Windows?" Timothy suggested. "Or Linux?"
"That is the decision of the AMI," Margaret said, writing it out: Amazon Machine Image.
"Think of an AMI as a master copy of a hard drive," she continued. "It includes the Operating System and any software you want pre-installed. When we launch our instance, AWS takes a snapshot of that master image and pastes it onto our new server."
"So I don't have to install the Operating System myself?"
"Heavens no," Margaret scoffed. "We are engineers, Timothy, not mechanics. We select the Amazon Linux 2 AMI, and the server wakes up ready to work."
Security Groups (The Firewall)
Timothy looked at the diagram. "Okay. I have a t3.medium instance running Linux. I am ready to log in."
Margaret shook her head. She drew a thick, dotted circle around the square box on the chalkboard.
"If you launch this server now, Timothy, who can talk to it?"
Timothy shrugged. "Me?"
"Everyone," Margaret corrected sternly. "Or no one. Depending on the rules. This circle is the Security Group. It is a virtual firewall that controls traffic."
She drew a small gate in the circle.
"By default, the Security Group blocks everything. It is a locked room. If you want to log in, you must open a specific Port."
She wrote Port 22 (SSH) next to the gate.
"Port 22 is the administration door. We open this only for your specific IP address. If you open it to the world, hackers will be trying to guess your password within minutes."
"And for the users?" Timothy asked. "They need to see the website."
Margaret drew a second gate. "For them, we open Port 80 (HTTP) or Port 443 (HTTPS). We allow the whole world to enter through that gate, but only to look at the website. They cannot touch the administration tools."
The Lesson
Margaret stepped back from the chalkboard. The diagram was complete: A box labeled EC2, defined by its Instance Type and AMI, surrounded by a protective Security Group.
"It seems straightforward," Timothy said. "I rent the machine, I choose the power, I pick the software, and I lock the door."
"Correct," Margaret said. She dusted her hands again. "But there is one final rule, Timothy."
"What is that?"
"Cost," she said. "This is not like the physical server in the basement that we bought ten years ago. This is a taxi meter. It ticks every second the instance is running."
She looked him in the eye.
"When you are finished for the day, you must Stop the instance. Stop pauses the meter but keeps the hard drive intact. If you Terminate, you destroy the machine and the data forever."
Timothy swallowed. "I will make a note of that."
"Do," Margaret said, pointing to the board. "Now, pick up that eraser. We have work to do."
Aaron Rose is a software engineer and technology writer at tech-reader.blog and the author of Think Like a Genius.
.jpeg)

Comments
Post a Comment