AWS EC2 quick reference and cheat sheet

  1. Amazon EC2 is the virtual server instances on the AWS cloud.
  2. Amazon EC2 provides varying combinations of CPU, memory, storage, and networking capacity instance.
  3. EC2 AMIs are either backed by Amazon EBS or backed by instance store.
  4. You are limited to running On-Demand Instances per your vCPU-based On-Demand Instance limit.
  5. Amazon EC2 currently supports Amazon Linux, Ubuntu, Windows Server, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, Fedora, Debian, CentOS, Gentoo Linux, Oracle Linux, and FreeBSD.
  6. You have full control at the operating system layer With EC2 instance.
  7. Key pairs are used to securely connect to EC2 instances:
  8. Ephemeral storage can be considered as non-persist or temporary storage.
  9. The contents of the instance store, or ephemeral storage will be lost on when instance is shut down ie; Data on any instance store volumes persists only during the life of the instance.
  10. Boot time for an instance on Amazon EBS-backed AMI is usually less than 1 minute.
  11. Boot time for an instance on Amazon instance store-backed AMI is usually less than 5 minutes.
  12. Size limit for a root device 16 TiB for Amazon EBS-backed AMI
  13. Size limit for a root device 10 GiB for Amazon instance store-backed AMI
  14. EC2 could attach Elastic Block Storage which allows for data persistence.
  15. For ephemeral storage, if the instance restarts, or the host experiences issues, you can incur data loss.

AWS EC2 userdata

  1. AWS userdata is the set of commands or data you can provide to execute in a instance at launch time.
  2. User data must be base64-encoded.
  3. User data will be run only once during instance start.
  4. User data will run with root user login.
  5. User data is limited to 16 KB in raw form, before it is base64-encoded.
  6. Instance metadata is data about your instance that you can manage the running instance.
  7. User data and metadata are not encrypted.

AWS EC2 On demand Instance:

  1. Pay for hours used : No commitment.
  2. Low cost and flexibility : No upfront cost.
  3. Ideal for auto scaling groups and unpredictable workloads.
  4. Good for Development/Adhoc Jobs / Testing

AWS EC2 Spot Instance :

  1. This will use unused EC2 capacity in the AWS cloud.
  2. Spot Instances are available at up to a 90% discount compared to On-Demand prices.
  3. Use Spot Instances for various stateless, fault-tolerant, or flexible applications such as big data, containerized workloads, CI/CD, web servers, high-performance computing (HPC), and other test & development workloads.
  4. Request Spot Instances by using the Spot management console, CLI, API or the same interface that is used for launching On-Demand instances by indicating the option to use Spot.
  5. You can also select a Launch Template or a pre-configured or custom Amazon Machine Image (AMI), configure security and network access to your Spot instance, choose from multiple instance types and locations, use static IP endpoints, and attach persistent block storage to your Spot instances.
  6. The Spot price is determined by long term trends in supply and demand for EC2 spare capacity.
  7. You don’t have to bid for Spot Instances in the new pricing model, and you just pay the Spot price that’s in effect for the current hour for the instances that you launch.
  8. Spot Instances receive a two-minute interruption notice when these instances are about to be reclaimed by EC2, because EC2 needs the capacity back.
  9. Instances are not interrupted because of higher competing bids.
  10. Each instance family, each instance size, in each Availability Zone, in every Region is a separate Spot pool.
  11. You can use the RequestSpotFleet API operation to launch thousands of Spot Instances and diversify resources automatically.
  12. To reduce the impact of interruptions, you can also set up Spot Instances and Spot Fleets to respond to an interruption notice by stopping or hibernating rather than terminating instances when capacity is no longer available.

AWS EC2 Reserved Instance:

  1. Purchase usage of EC2 instances in advance.
  2. Provides a capacity reservation when used in a specific AZ.
  3. AWS Billing automatically applies discounted rates when you launch an instance that matches your purchased Reserved instance.
  4. Capacity is reserved for a term of 1 or 3 years.
  5. EC2 has three types of reserved instance types: Standard, Convertible, and Scheduled.
    1. Standard Reserved instance :  Commitment of 1 or 3 years, charged whether it’s on or off.
    2. Scheduled Reserved instance :  Reserved for specific periods of time, accrue charges hourly, billed in monthly increments over the term (1 year).
    3. Convertible Reserved Instance :  One-year to three-year term. Enables you to modify Availability Zone, scope, networking type, and instance size (within the same instance type) of your Reserved Instance.
  6. Scheduled Reserved instance match your capacity reservation to a predictable recurring schedule.
  7. Reserved instances are used for steady state workloads and predictable usage.
  8. Ideal for applications that need reserved capacity.
  9. Upfront payments can reduce the hourly rate.
  10. Can switch AZ within the same region.
  11. Can change the instance size within the same instance type.
  12. Instance type modifications are supported for Linux only.
  13. Cannot change the instance size of Windows RIs.
  14. Billed whether running or not.
  15. Can sell reservations on the AWS marketplace.
  16. Can be used in Auto Scaling Groups.
  17. Can be used in Placement Groups.
  18. Can be shared across multiple accounts within Consolidated Billing.
  19. You can try to sell them on the Reserved Instance Marketplace, if you are not using.

AWS EC2 Dedicated hosts:

  1. Physical servers dedicated just for your use.
  2. You then have control over which instances are deployed on that host.
  3. Available as On-Demand or with Dedicated Host Reservation.
  4. Useful if you have server-bound software licenses that use metrics like per-core, per-socket, or per-VM.
  5. Each dedicated host can only run one EC2 instance size and type.
  6. Good for regulatory compliance or licensing requirements.
  7. Predictable performance.
  8. Complete isolation.
  9. Most expensive option.
  10. Billing is per host.

AWS EC2 Dedicated instances:

  1. Virtualized instances on hardware just for you.
  2. Uses physically dedicated EC2 servers.
  3. Does not provide the additional visibility and controls of dedicated hosts.
  4. Billing is per instance.
  5. May share hardware with other non-dedicated instances in the same account.
  6. Available as On-Demand, Reserved Instances, and Spot Instances.
  7. Cost additional $2 per hour per region.
  8. Partial instance-hours consumed are billed based on instance usage.

Different type of IP that EC2 instance can have

  1. There are three types of IP address that can be assigned to an Amazon EC2 instance:
    1. Public IP– Public address that is assigned automatically to instances in public subnets and reassigned if instance is stopped/started.
    2. Private IP– Private address assigned automatically to all instances.
    3. Elastic IP – Public address that is static.
  2. Public IPv4 addresses are lost when the instance is stopped but private addresses (IPv4 and IPv6) are retained.
  3. Public IPv4 addresses are retained if you restart the instance.
  4. Elastic IPs are retained when the instance is stopped.
  5. Elastic IP addresses are static public IP addresses that can be remapped between instances.
  6. Accounts are limited to 5 elastic IPs per region by default.
  7. AWS charge for elastic IP’s when they’re not being used.
  8. An Elastic IP address is for use in a specific region only.
  9. You can assign custom tags to your Elastic IP addresses to categorize them.
  10. By default, EC2 instances come with a private IP assigned to the primary network interface (eth0).
  11. Public IP addresses are assigned for instances in public subnets (VPC).
  12. Public IP addresses are always assigned for instances in EC2-Classic.
  13. DNS records for elastic IP’s can be configured by filling out a form.
  14. Secondary IP addresses can be useful for hosting multiple websites on a server or redirecting traffic to a standby EC2 instance for HA.
  15. You can choose whether secondary IP addresses can be reassigned.
  16. You can associate a single private IPv4 address with a single Elastic IP address and vice versa.
  17. When reassigned the IPv4 to Elastic IP association is maintained.
  18. When a secondary private address is unassigned from an interface, the associated Elastic IP address is disassociated.
  19. You can assign or remove IP addresses from EC2 instances while they are running or stopped.
  20. All IP addresses (IPv4 and IPv6) remain attached to the network interface when detached or reassigned to another instance.
  21. You can attach a network interface to an instance in a different subnet as long as its within the same AZ.


  1. Instance metadata is available at
  2. Instance user data is available at:
  3. The IP address is a link-local address and is valid only from the instance.
  4. To view metadata and userdata try this from your instance curl
  5. The Instance Metadata Query tool allows you to query the instance metadata without having to type out the full URI or category names.
  6. When you initiate hibernation, the instance moves to the stopping state. Amazon EC2 signals the operating system to perform hibernation (suspend-to-disk). The hibernation freezes all of the processes, saves the contents of the RAM to the EBS root volume, and then performs a regular shutdown.

Reference Pages
AWS EC2 Home page
EC2 Features
EC2 Instance Types
EC2 Instance Explorer

Author: user

Leave a Reply