Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for EC2 Essentials: Your Gateway to Cloud Computing
Lindiwe Dokotala
Lindiwe Dokotala

Posted on

     

EC2 Essentials: Your Gateway to Cloud Computing

Knowing how to useElastic Compute Cloud (EC2) is fundamental to understanding how the cloud works. This article will introduce you to the essentials of EC2, highlighting its key features and advantages, so you can confidently leverage its capabilities to enhance your applications and infrastructure.

Buckle up and learn

So what is Amazon EC2? Well, EC2 is the most popular AWS offering definitely used everywhere. It is the way to do Infrastructure as a Service on AWS.EC2 is not just one service, it is composed of many things at a high level.
It mainly consists of the following capabilities:

  1. You can rent virtual machines -> EC2 instances.

  2. Storing data on virtual drives (EBS volumes)

  3. Distributing load/traffic across machines(Elastic Load
    Balancers)

  4. Scaling the services using an EC2 auto-scaling group(ASG)

The cloud is to be able to rent these compute whenever you need, on-demand and EC2 is just that. Here are the EC2 sizing and configuration options we can choose for the virtual servers we rent from AWS:

• Choose any of these Operating Systems (OS): Linux, Windows
or Mac OS
• How much compute power & cores (CPU)
• How much random-access memory (RAM)
• How much storage space:
i. Network-attached (EBS & EFS)
ii. Hardware (EC2 Instance Store)

• Type of network you want to attach to your EC2 instance
-Network card: speed of the card, Public IP address

• Handle firewall rules with security groups
• Bootstrap script (to configure the instance at first
launch)~EC2 User Data

EC2 User Data

  • It is possible to bootstrap our instances using anEC2 User Data script.
  • Bootstrapping means launching commands when a machine starts.
  • That script isonly run once at the instance'sfirst start.
  • EC2 user data is used to automate boot tasks such as:
    1. Installing updates
    2. Installing software
    3. Downloading common files from the internet
    4. Anything you can think of but the more you add in your EC2 user data script the more your instance has to do at boot time.
  • The EC2 User Data script runs as the root user, meaning any command you provide will have sudo rights.

Examples of EC2 instance types you will come across

ec2 instance types
Happy cloud exploring!
I’d love to hear your thoughts, so please share them in the comment section.

Top comments(4)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
respect17 profile image
Kudzai Murimi
FullStack Developer and Content Writer
  • Location
    Capetown, South Africa
  • Joined

Great Job!
I'm curious, how would you recommend optimizing EC2 costs for a growing application that experiences unpredictable traffic spikes? Would using a mix of reserved instances, spot instances, and auto-scaling be an effective strategy, or are there other cost-saving techniques that work better in such scenarios?

CollapseExpand
 
lindiwe09 profile image
Lindiwe Dokotala
I'm a frontend software developer and AWS certified |Aspiring DevOps | AWS Community Builder
  • Location
    Cape Town, SA
  • Education
    Freecodecamp
  • Work
    Software Developer | Cloud Engineer
  • Joined

Thank you for your question@respect17 ! Optimizing EC2 costs for a growing application with unpredictable traffic spikes can be challenging, but a solid strategy can make a difference.

Using a mix of Reserved Instances, Spot Instances, and Auto Scaling is often an effective approach:
Auto Scaling Groups: Implementing Auto Scaling helps your application dynamically adjust capacity based on demand. This is crucial for unpredictable traffic, allowing you to run only the resources needed at any time, avoiding over-provisioning.

Reserved Instances: If you have a predictable baseline of usage, purchasing Reserved Instances (RIs) can significantly reduce costs for that portion of your compute needs. They require a commitment of 1 or 3 years for consistent instance configurations (type and Region).

Spot Instances: For unexpected traffic spikes, Spot Instances allow you to request unused EC2 capacity, often at a lower cost than On-Demand Instances. However, they can be interrupted, so ensure your application can handle interruptions or has a fallback mechanism (like Auto Scaling launching On-Demand instances when Spot instances are unavailable).

In addition, consider using Savings Plans for flexibility, right-sizing instances, and utilizing AWS Compute Optimizer for cost recommendations. Combining these strategies can achieve a balance between cost savings and reliability, ensuring your application remains responsive to fluctuating demands. If you have more questions, feel free to ask!

CollapseExpand
 
devnenyasha profile image
Melody Mbewe
Software Developer
  • Location
    Cape Town, South Africa
  • Education
    Harare Institute Of Technology
  • Pronouns
    She
  • Work
    Frontend Software Developer
  • Joined

Great breakdown of EC2! It's a solid guide to effectively leverage EC2. 🌩️

CollapseExpand
 
lindiwe09 profile image
Lindiwe Dokotala
I'm a frontend software developer and AWS certified |Aspiring DevOps | AWS Community Builder
  • Location
    Cape Town, SA
  • Education
    Freecodecamp
  • Work
    Software Developer | Cloud Engineer
  • Joined

Thank you Melody!
I’m glad you found the breakdown helpful.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I'm a frontend software developer and AWS certified |Aspiring DevOps | AWS Community Builder
  • Location
    Cape Town, SA
  • Education
    Freecodecamp
  • Work
    Software Developer | Cloud Engineer
  • Joined

More fromLindiwe Dokotala

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp