What is an elastic ip?
Public IPv4 you own as long as you don’t delete it
Add an elastic IP
Then delete it
EC2
Network and Security
- elastic IP
- Amazon’s pool of IPv4 addresses
Right click your created elastic ip
- action
- associate elastic ip address- instance
- give the private ip you want to associate
DELETION
- click you elastic IP and disassociate it.
- Release it
What are Placement Groups?
Where your instances are placed physically
Cluster
Parition
Spread
What are the Placement Group Strategies below:
Cluster
Spread
Partition
Cluster - Instance grouped together in low-latency group in single AZ
Spread - Spreads instances across underlying hardware (max 7 instances per group per AZ) - critical apps
Partition - Spreads instances across many different partitions. 100s of instance per group. (hadoop, cassandra, kafka)
Cluster - speed
Spread - resilience, separated, different AZs
Partition - seperated, but in the same building, different racks. Mix of Cluster and Spread
Placement Groups - Cluster
Low Latency
10 Gbps
If AZ fails all instances fail at same time
Use Case:
big data jobs
apps that need low latency
Placement Groups - Spread
Minimize failure risk
All EC2s are on different hardware
Span across AZs
Reduce risk of failure
limited to 7 instance per AZ per placement group
Use Case:
App that needs to maximize it’s high availability
Critical apps
Placement Groups - Partitions
Many EC2 instances in a partition (rack)
7 partitions per AZ and they can span across multiple AZs in same region
Create a placement group
Launch an instance in this group
EC2
Network & Security
Placement Groups
name - my-high-performance group
placement strategy - cluster
my-critical-group - spread - Rack
my-distributed-group - partition - 4 (partitions)
LAUNCH
Instances
launch
Advanced
- placement group name (drop down)
What is an ENI
Elastic Network Interfaces
Logical component in VPC that represents a virtual Network Card
- primary private ipv4 and on secondary
- one or more security groups
- mac address
- create ENI independently and move them
- bound to AZ
These don’t dissapear like the default ones after you’re done
Check ENIs on your instances
Create an ENI
you can create two instances of something when creating under Summary
Click you instance
Networking
Network Interfaces
View ENIs
EC2
Network Interfaces
Create network interface
Action
attach
Instance - whatever
action
detach
What is EC2 Hibernate
RAM is preserved. Super fast book.
RAM is written in file in the root EBS volume while it hybernates
encrypted
Can’t go over 60 days
Create a hibernate instance
EC2
Create instance
Stop - Hibernate behavior - Enable
We’ll have to encrypt storage now
# Scroll to storage and click advanced
Encrypt - Yes
KMS key - aws/ebs
What are EBS volumes?
Elastic Block Store
Network Drive you can attach while running
Only one instance at a time
Bound to AZ
Like a network USB
Have to provision GBs and IOPS in advance but can increase over time
What is Delete on Termination in terms of EBS?
Second to last column - By default when you instance is deleted so is your EBS volume
By default any other EBS volume is not deleted.
Look at EBS on your machine
Create an EBS
Attach
EC2
Instance
click an instance
Storage tab
Look at root and block devices
Click the volume
OR
Scroll all the way down on the left-hand side under Elastic Block Storage click Volume -> Create volume
Size 2 GiB
Availability Zone (Match your EC2 instance - you can find that in your instance’s network settings)
Now check it
Actions
Attach
Click you instance
Attach Volume
TO CHECK LOOK AT STORAGE FOR BLOCK DEVICES ON INSTANCE
Check if you Volume is delete on Termination
Look at your EBS volumes and you’ll see it on the far right
What is an EBS snapshot
What is an EBS Snapshot Archive
What is Recycle Bin for EBS Snapshots?
What is FSR?
SNAPSHOT
snapshot of EBS volume
Copy across AZ or region
SNAPSHOT ARCHIVE
- Snapshot archive tier is 75% cheaper
- Takes within 24 to 72 hours for restoring the archive
RECYCLE BIN
- Rule to retain deleted snapshot so you can recover after accidental deletion
- Specify retention (from 1 day to 1 year)
FAST SNAPSHORT RESTORE
- Force full initialization of snapshot to have no latency on first use (bunchamoney)
Create an EBS Snapshot
View All snapshots and copy it to a different region
Recreate a volume from your snapshot
Show recycle bin and create a rule
CREATE SNAPSHOT
EC2
Elastic Block Storage
Actions
- Create snapshot
Create Snapshots
COPY SNAPSHOT
EC2
Elastic Block Storage
- Snapshots
right click EBS
Copy snapshot
Select Destination Region
RECREATE VOLUME FROM SNAPSHOT
EC2
Elastic Block Storage
Snapshots
Select your snapshot
Actions
- Create a volume from a snapshot
Choose an AZ
RECYCLE BIN
EC2
Elastic Block Storage
Snapshots
Recycle Bin
Create retention rule
Describe AMI
Amazon Machine Image - customization of EC2 instance
- add software, configuration, OS, monitoring, faster boot, config time
Can be built in specific region and copied over to different ones
What options do you have for obtaining an AMI? There’s 3
Public AMI from AWS
Your own
AWS Marketplace AMI
Create AMI
Launch instance
AWS Linux 2 is fine
Key Pair (whatever)
Edit network setting and select a security group
User Data:
Make a script that updates and install httpd as well as system, just don’t create the httpd page itself.
Right click you instance
- Image and templates
- create image
CHECK YOUR AMIS
Images (left-hand side)
AMIs
You can launch instances from there directly or select to use an AMI when launching a new instance.
If selecting by a new instance, instead of selecting your OS the normal way, select the My AMIs tab and select the one you want
Now you can just modify the index.html file and you’re good to go
Where would you go for high-performance hardware disks?
EC2 Instance Store - these are ephemeral (they are lost upon stopping)
Good for buffer, cache, etc
Risk data loss if hardware fails
Backups and replications your responsibility
What are the below EBS Volume Types
- gp2/gp3
- io1/io2
- st1
- sc1
General Purpose SSD (gp2-3)
Cost effective low latency
1GiB - 16TiB
gp3 - 3000 IOPS - independently set IOPS
gp2 - up to 16,000 IOPS - IOPS are linked to size of Volume