AWS Associate Architect Certification Lecture 12 — EC2 part 9 — Some more points about EC2
3 min readOct 15, 2020
Hi,
There are some topics I would like to discuss about EC2.
A. How to access EC2?
- To access instances , you need a key and key pair name.
- You can download the private key only once.
- 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.
- Without key pair you can not access the instances via RDP or SSH(Linux).
- 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?
- By default AWS EC2 service performs automated status checks every one minute.
- This is done on every running EC2 to identify every hardware and software issue.
- Status check is inbuilt on every EC2 instance.
- EC2 instances can send its status check meta data to Cloudwatch every 5 minute.(by default and free)
- Enable detail monitoring is chargeable and sends metric every minute.
- You are not charged for stopped EC2 instances but attached storage volumes like EB2, S3 are chargeable.
C. EC2 types
- EBS backed EC2 instance.
- instance store backed EC2 instance.
Lets see each type one by one.
a. EBS backed instance
- most common replicate with AZ by taking snapshots.
- EBS volumes attached to running ec2 instances will not be deleted when terminated but are detached with data interact.
- network attached
b. instance store backed instance
- direct attached so faster
- physically attached with host server.
- data is not lost when OS is rebooted
- data is lost when
a. underlying drive fails
b. instance is stopped or terminated - You cant detach or attach with another instance
- do not rely on for valuable long term data
D. What happens when you stops EBS backed EC2 instance?
- instances performs a shutdown.
- state changes from running to stopping.
- EBS volume remains attached to the instance so data in EBS persists.
- Any data cached in RAM or instance store volume is gone.
- Instances retains its private IPV4 or any IPV6 address.
- Instances releases its public IPV4 address back to AWS pool.
- Instances retain its Elastic IP address.
E. What happens when you terminate a running instances?
- The state changes to running -> shutting down -> terminate.
- during the shut down and terminate states, you do not incurr charges.
- By default EBS root volumes are deleted automatically when EC2 instance is terminated.
- Any additional (non root/root) volumes attached to the instances by default persist after instance is terminated.
- You can modify both the behaviors by modifying the “Delete on Termination” attribute of any EBS volumes during instance launch or running.
- Enable “EC2 termination protection” against accidental termination.
F. How to check EC2 metadata?
- 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.
- metadata can be only viewed only when you login into instance.
- Metadata is not pretected with encryption
- to view instance metadata get https://169.254.169.254/latest/metadata.
G. What about Instance user data?
- data supplied by the user at instance launch in the form of script to be executed during instance boot.
- user data is limited to 16kb
- You can change user data by stopping EC2
- user data is not encrypted
H. EC2 bare metal instances
- you know where your software is installed in which hardware.
- (.metal) is added in name of instances.
- non virtualized environment.