0
0
AWScloud~30 mins

Why EC2 matters for compute in AWS - See It in Action

Choose your learning style9 modes available
Why EC2 Matters for Compute
📖 Scenario: You are starting a small web application project. You need a place to run your application code on the cloud. Amazon EC2 (Elastic Compute Cloud) lets you rent virtual computers to run your programs.Think of EC2 as renting a computer in the cloud that you can control, just like your own laptop, but accessible from anywhere.
🎯 Goal: Build a simple EC2 instance configuration using AWS CloudFormation to launch a virtual server with a specific name and instance type.This will help you understand how EC2 provides compute power in the cloud.
📋 What You'll Learn
Create a CloudFormation template with a resource of type AWS::EC2::Instance
Set the instance type to t2.micro
Name the instance with the tag Key 'Name' and Value 'MyFirstEC2Instance'
Use the Amazon Linux 2 AMI ID for the instance
Ensure the template is valid and deployable
💡 Why This Matters
🌍 Real World
EC2 instances are the basic building blocks for running applications, websites, and services on AWS. Knowing how to configure them is essential for cloud computing.
💼 Career
Cloud engineers and developers often create and manage EC2 instances to deploy software and scale infrastructure.
Progress0 / 4 steps
1
Create the basic CloudFormation template structure
Create a CloudFormation template starting with the root keys AWSTemplateFormatVersion set to '2010-09-09' and an empty Resources section.
AWS
Need a hint?

Start with the basic CloudFormation template keys.

2
Add an EC2 instance resource with instance type
Inside the Resources section, add a resource named MyEC2Instance of type AWS::EC2::Instance and set its InstanceType property to t2.micro.
AWS
Need a hint?

Define the EC2 instance resource with the correct type and instance size.

3
Add the Amazon Linux 2 AMI ID to the instance
Add the ImageId property to MyEC2Instance and set it to the Amazon Linux 2 AMI ID ami-0c02fb55956c7d316 (this is a common AMI in us-east-1 region).
AWS
Need a hint?

Use the correct AMI ID for Amazon Linux 2 to launch the instance.

4
Add a Name tag to the EC2 instance
Add a Tags property under Properties of MyEC2Instance. Set it to a list with one tag object having Key as Name and Value as MyFirstEC2Instance.
AWS
Need a hint?

Tags help identify your instance. Add the Name tag as shown.