Skip to content

Lesson 04 — Launching Secure EC2 Instances

Learning Path

☁️ Phase 2 – AWS Cloud Security

📘 Module 05 – Amazon EC2 Security


By the end of this lesson, you will be able to:

  • Launch secure Amazon EC2 instances.
  • Select the appropriate AMI and Instance Type.
  • Configure networking securely.
  • Attach IAM Roles.
  • Configure encrypted EBS volumes.
  • Apply enterprise tagging standards.
  • Validate a secure EC2 deployment.

📚 Lesson Information

Estimated Time: 2–3 Hours

Difficulty: Beginner → Intermediate

Prerequisites: Lesson 03 – Amazon EC2 Fundamentals

Hands-on Lab: Yes


CloudNova Technologies is ready to deploy the first production application.

The networking team has completed:

  • Enterprise VPC
  • Public Subnets
  • Private Application Subnets
  • Private Database Subnets
  • Security Groups
  • Route Tables
  • Internet Gateway
  • NAT Gateway
  • VPC Endpoints

Your responsibility is to deploy secure application servers that comply with CloudNova’s security standards.


Many beginners launch EC2 instances using the default settings.

Launch Instance
Next
Next
Launch

Although the instance works, it may have:

  • Public IP enabled
  • Default Security Group
  • No IAM Role
  • Unencrypted storage
  • Weak tagging
  • No monitoring

In enterprise environments, this is unacceptable.

Every deployment must follow a secure configuration process.


CloudNova follows this workflow for every EC2 deployment.

Choose AMI
Select Instance Type
Choose Secure Network
Attach IAM Role
Configure Storage
Configure Security Group
Add Tags
Review
Launch
Validate
Monitor

Our application server will use:

Component Value
AMI Amazon Linux 2023
Instance Type t3.micro
VPC CloudNova-Prod-VPC
Subnet Private-App-A
Public IP Disabled
IAM Role CloudNova-EC2-Role
Security Group App-SG
Root Volume Encrypted GP3
Monitoring Enabled

Internet
Internet Gateway
Application Load Balancer
Private App Subnet
Amazon EC2 Instance
┌─────────────────┼─────────────────┐
│ │ │
IAM Role Encrypted EBS Security Group
AWS Systems Manager
CloudWatch

Notice that the EC2 instance does not have a Public IP Address.

Administrative access is provided through AWS Systems Manager Session Manager, which is more secure than exposing SSH to the Internet.


🛠 Lab 01 — Launch a Secure EC2 Instance

Section titled “🛠 Lab 01 — Launch a Secure EC2 Instance”

Open:

AWS Console
EC2
Instances
Launch Instance

CloudNova-App-Server-01

Naming resources consistently makes them easier to identify and manage.


Select:

Amazon Linux 2023

Why?

  • AWS maintained
  • Regular security updates
  • Optimised for AWS services
  • Long-term support

Choose:

t3.micro

Suitable for:

  • Learning
  • Small web applications
  • Development
  • AWS Free Tier (where applicable)

Select an existing Key Pair or create a new one.

Example:

CloudNova-KeyPair

Download and securely store the private key (.pem file).

Note: In later lessons, we’ll use AWS Systems Manager Session Manager for administration, reducing the need for direct SSH access.


Click Edit under Network Settings.

Configure:

Setting Value
VPC CloudNova-Prod-VPC
Subnet Private-App-A
Auto-assign Public IP Disabled

This ensures the instance is not directly accessible from the Internet.


Select:

App-SG

Allow only the required inbound traffic.

Example:

Protocol Source
HTTPS (443) ALB-SG
SSH (22) Bastion-SG or Session Manager (preferred)

Avoid using:

0.0.0.0/0

unless absolutely necessary.


Select:

CloudNova-EC2-Role

This IAM Role will later allow the instance to securely access:

  • Amazon S3
  • CloudWatch
  • Systems Manager
  • Secrets Manager

without storing AWS Access Keys.


Configure:

Setting Value
Volume Type gp3
Size 20 GiB
Encryption Enabled

Encryption protects data if storage media is compromised.


Enable:

Detailed CloudWatch Monitoring

Benefits:

  • Faster metrics
  • Better troubleshooting
  • Improved alerting

Create tags.

Key Value
Name CloudNova-App-Server-01
Environment Production
Project Learning Platform
Owner Cloud Security
Department IT

Tagging improves visibility, governance and cost management.


Verify:

  • Correct AMI
  • Correct Instance Type
  • Private Subnet
  • No Public IP
  • Correct Security Group
  • IAM Role attached
  • Encrypted EBS
  • Tags added

Click:

Launch Instance

Open:

EC2
Instances

Verify:

  • Instance State = Running
  • System Status = 2/2 Checks Passed

Review:

  • Networking
  • Security
  • Storage
  • IAM Role
  • Monitoring

Terminal window
aws ec2 run-instances \
--image-id ami-xxxxxxxx \
--instance-type t3.micro \
--subnet-id subnet-xxxxxxxx \
--security-group-ids sg-xxxxxxxx \
--iam-instance-profile Name=CloudNova-EC2-Role \
--block-device-mappings '[{"DeviceName":"/dev/xvda","Ebs":{"VolumeSize":20,"VolumeType":"gp3","Encrypted":true}}]' \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=CloudNova-App-Server-01}]'

Terminal window
aws ec2 describe-instances

Terminal window
aws ec2 describe-security-groups

Terminal window
aws ec2 describe-volumes

Terminal window
aws ec2 describe-tags

Terminal window
aws ec2 stop-instances \
--instance-ids i-xxxxxxxx

Terminal window
aws ec2 start-instances \
--instance-ids i-xxxxxxxx

Verify the following:

✔ EC2 instance is running.

✔ Deployed into the correct VPC.

✔ Located in the Private Application Subnet.

✔ No Public IP assigned.

✔ IAM Role attached.

✔ Security Group configured.

✔ EBS volume encrypted.

✔ Tags applied.

✔ CloudWatch monitoring enabled.


Instance launch failed.

Check:

  • Service quotas.
  • Subnet capacity.
  • AMI availability.
  • IAM permissions.

Instance not reachable.

Verify:

  • Correct Security Group.
  • Route Tables.
  • NAT Gateway.
  • Systems Manager configuration.

IAM Role missing.

Check:

  • Instance Profile exists.
  • Correct IAM Role selected.
  • Required IAM permissions granted.

EBS encryption disabled.

Review:

  • Volume configuration.
  • Default EBS encryption settings.
  • Account encryption policies.

CloudNova standards:

  • Deploy production servers in Private Subnets.
  • Disable Public IP addresses unless required.
  • Encrypt all EBS volumes.
  • Use IAM Roles instead of Access Keys.
  • Apply consistent resource tags.
  • Enable CloudWatch monitoring.
  • Restrict Security Group rules.
  • Use Session Manager for administration whenever possible.
  • Validate deployments before handing them over to application teams.

❌ Deploying EC2 instances into Public Subnets unnecessarily.

❌ Leaving SSH open to 0.0.0.0/0.

❌ Launching unencrypted EBS volumes.

❌ Forgetting to attach an IAM Role.

❌ Using the default Security Group without review.

❌ Skipping resource tagging.

❌ Forgetting to enable monitoring.


Launch a second application server:

CloudNova-App-Server-02

Requirements:

  • Amazon Linux 2023
  • t3.micro
  • Private-App-B Subnet
  • App-SG
  • IAM Role attached
  • Encrypted GP3 volume
  • Public IP disabled
  • Enterprise tags applied

After deployment:

  1. Compare the configurations of both instances.
  2. Verify that both comply with CloudNova’s standards.
  3. Record any differences and explain why they exist.

Take screenshots of:

  • EC2 Dashboard
  • Networking
  • Security Group
  • IAM Role
  • Storage
  • Tags
  • AWS CLI outputs

  1. Why should production EC2 instances typically be launched in Private Subnets?
  2. Why is Amazon Linux 2023 a common choice for AWS workloads?
  3. What is the purpose of an IAM Role attached to an EC2 instance?
  4. Why should EBS volumes be encrypted?
  5. Why should Public IP addresses be disabled for application servers?
  6. What is the advantage of using AWS Systems Manager instead of SSH?
  7. Why are resource tags important in enterprise environments?
  8. Which AWS CLI command launches a new EC2 instance?
  9. What checks should you perform after launching an instance?
  10. Which CloudNova deployment standard contributes most to reducing the attack surface?

After completing this lesson, you should understand:

  • Launching an EC2 instance securely involves much more than selecting an AMI and clicking Launch.
  • Secure deployments require careful configuration of networking, identity, storage and monitoring.
  • Private Subnets, IAM Roles, encrypted EBS volumes and properly configured Security Groups are fundamental building blocks of a secure EC2 environment.
  • Enterprise standards such as consistent tagging, validation and monitoring improve security, governance and operational efficiency.
  • Following a repeatable deployment workflow helps ensure every EC2 instance is built securely and consistently.

➡️ Lesson 05 — IAM Roles for EC2