DEV Community

Morodolu Oluwafikunayomi
Morodolu Oluwafikunayomi

Posted on

Snapshots and AMIs in AWS, What They Are and How to Use Them

when using EC2 instances in AWS, understanding Snapshots and AMIs (Amazon Machine Images) can boost productivity and reduce resource consumption and ensure efficiently. Whether you're planning for disaster recovery, creating golden images for production, or just trying to replicate environments, this guide will walk you through what they are, how they differ, and how to actually create and use them.
What Is a Snapshot?
A Snapshot in AWS is a point-in-time backup of your EBS (Elastic Block Store) volume. Think of it like taking a photo of your disk, which you can later use to create new volumes or restore existing ones.
Use cases:

  • Backup and restore
  • Version control for data
  • Migrating data across regions
    What Is an AMI?
    An Amazon Machine Image (AMI) is a packaged template for launching EC2 instances in the sense that rather than going through the stress of creating a new instance and connecting to, AMI provide a means of shorting that creation process. It includes:

  • An operating system

  • Application server

  • Your application

  • EBS volume snapshot(s)
    A Snapshot is of a disk. An AMI is like a full system image (disk + OS + config).
    Use cases:

  • Launching pre-configured servers

  • Auto Scaling

  • Disaster recovery

  • Rapid cloning of environments

How to Create a Snapshot in AWS
From the Console:
remember to have created a volume initially, as a snapshot cannot work without a volume
check out my other post if don't know how to create a volume(EBS)

  • Go to EC2 Dashboard > Elastic Block Store > Volumes
  • Select the volume you want to snapshot.
  • Click Actions > Create Snapshot
  • Add a name and description.
  • Click Create Snapshot

now we have created a snapshot, let go ahead to delete our volume and recreate the volume from the snapshot
the volume i created was 1 Gib

the size of the volume you wish to create can be increased
When you create a snapshot of an EBS volume, AWS stores the data, not the disk size limitation. That means the snapshot contains the data blocks and metadata needed to recreate the original volume — but it doesn’t restrict you to the original size.


then go ahead to create the volume


the arrows show it was created from a snapshot and its id

How to Create an AMI from an EC2 Instance
From the Console:

  • Go to EC2 > Instances
  • Select your running instance.
  • Click Actions > Image and templates > Create image
  • Enter image name, description, and choose whether to reboot or not.
  • Click Create image
    ** Launching an EC2 from AMI**
    Once your AMI is ready (it takes a few minutes), you can launch a new EC2 from it.
    From Console:

  • Go to EC2 > AMIs

  • Select your AMI

  • Click Launch instance from image

  • Choose instance type, key pair, security group, etc.

  • Launch!
    do note that AWS doesn't clean up your AMIs or snapshots automatically. You could be leaking storage $$$ if you don’t do it yourself.
    _ Don’t forget to delete the snapshot(s) manually and deregistering the AMI doesn’t remove them._

Top comments (0)