AWS Associate Architect Certification Lecture 12 — EC2 part 9 — Some more points about EC2

Amit Hendre
3 min readOct 15, 2020

Hi,

There are some topics I would like to discuss about EC2.

A. How to access EC2?

  1. To access instances , you need a key and key pair name.
  2. You can download the private key only once.
  3. The public key is saved by AWS to match to the key pair name and private key when you try to login the EC2 instance.
  4. Without key pair you can not access the instances via RDP or SSH(Linux).
  5. There is 20 EC2 instances soft limit per region, you can submit a request to AWS to increase it.

B. How to check status in EC2?

  1. By default AWS EC2 service performs automated status checks every one minute.
  2. This is done on every running EC2 to identify every hardware and software issue.
  3. Status check is inbuilt on every EC2 instance.
  4. EC2 instances can send its status check meta data to Cloudwatch every 5 minute.(by default and free)
  5. Enable detail monitoring is chargeable and sends metric every minute.
  6. You are not charged for stopped EC2 instances but attached storage volumes like EB2, S3 are chargeable.

C. EC2 types

  1. EBS backed EC2 instance.
  2. instance store backed EC2 instance.

Lets see each type one by one.

a. EBS backed instance

  1. most common replicate with AZ by taking snapshots.
  2. EBS volumes attached to running ec2 instances will not be deleted when terminated but are detached with data interact.
  3. network attached

b. instance store backed instance

  1. direct attached so faster
  2. physically attached with host server.
  3. data is not lost when OS is rebooted
  4. data is lost when
    a. underlying drive fails
    b. instance is stopped or terminated
  5. You cant detach or attach with another instance
  6. do not rely on for valuable long term data

D. What happens when you stops EBS backed EC2 instance?

  1. instances performs a shutdown.
  2. state changes from running to stopping.
  3. EBS volume remains attached to the instance so data in EBS persists.
  4. Any data cached in RAM or instance store volume is gone.
  5. Instances retains its private IPV4 or any IPV6 address.
  6. Instances releases its public IPV4 address back to AWS pool.
  7. Instances retain its Elastic IP address.

E. What happens when you terminate a running instances?

  1. The state changes to running -> shutting down -> terminate.
  2. during the shut down and terminate states, you do not incurr charges.
  3. By default EBS root volumes are deleted automatically when EC2 instance is terminated.
  4. Any additional (non root/root) volumes attached to the instances by default persist after instance is terminated.
  5. You can modify both the behaviors by modifying the “Delete on Termination” attribute of any EBS volumes during instance launch or running.
  6. Enable “EC2 termination protection” against accidental termination.

F. How to check EC2 metadata?

  1. This is the instance data that can be used to manage or configure the instance.e.g. IPV4, IPV6, instance type, local host name, public key, etc.
  2. metadata can be only viewed only when you login into instance.
  3. Metadata is not pretected with encryption
  4. to view instance metadata get https://169.254.169.254/latest/metadata.

G. What about Instance user data?

  1. data supplied by the user at instance launch in the form of script to be executed during instance boot.
  2. user data is limited to 16kb
  3. You can change user data by stopping EC2
  4. user data is not encrypted

H. EC2 bare metal instances

  1. you know where your software is installed in which hardware.
  2. (.metal) is added in name of instances.
  3. non virtualized environment.

--

--