AWS EC2
Instance Types
- On-demand - virtual instance, paid by the hour / second
- Reserved - capacity reservation (e.g. 1 or 3 years), where the longer you reserve the cheaper it is
- Spot - bid for instance capacity
- Dedicated hosts - physical EC2 server instances (allow you to use your existing server-bound licenses)
Instance Types Mnemonic - FIGHT-DR-MCPXZ-AU
- FGPA
- IOPS
- Graphics
- High Disk Throughput
- T - Cheap General Purpose (e.g. T2 micro)
- Density
- RAM
- Main Choice for General Apps
- Compute
- Graphics (thin pics)
- X - Extreme Memory
- Z - Extreme Memory & CPU
- ARM based workloads
- U - Bare Metal
Regions vs AZ vs Edge Locations
- A region is a physical location in the world which consist of two or more Availability Zones (AZ's)
- An AZ is one or more discrete data centers, each with redundant power, networking and connectivity, house in separate facilities
- Edge Locations are endpoints for AWS which are used for caching content. Typically this consists of CloudFront, Amazon's Content Delivery Network (CDN)
- Edge locations are not just read-only - you can write to them (i.e. PUT an object to them)
Autoscaling
"An Auto Scaling group is a collection of Amazon EC2 instances that are treated as a logical unit. You configure settings for a group and its instances as well as define the groupβs minimum, maximum, and desired capacity. Setting different minimum and maximum capacity values forms the bounds of the group, which allows the group to scale as the load on your application spikes higher or lower, based on demand. To scale the Auto Scaling group, you can either make manual adjustments to the desired capacity or let Amazon EC2 Auto Scaling automatically add and remove capacity to meet changes in demand. When launching fleets of instances, you can specify what percentage of your capacity should be fulfilled by On-Demand instances, and what percentage with Spot Instances, to save up to 90% on EC2 costs. Amazon EC2 Auto Scaling lets you provision and balance capacity across Availability Zones to optimize availability. It also provides lifecycle hooks, instance health checks, and scheduled scaling to automate capacity management."
Q&A
- Can I delete a snapshot of an EBS Volume that is used as the root device of a registered AMI? No.
- Which AWS CLI command should I use to create a snapshot of an EBS volume?
aws ec2 create-snapshot
. - I can change the permissions to a role, even if that role is already assigned to an existing EC2 instance, and these changes will take effect immediately. TRUE
- To retrieve instance metadata or user data you need to use the following IP address: http://169.254.169.254
- Will an Amazon EBS root volume persist independently from the life of the terminated EC2 instance to which it was previously attached? In other words, if I terminated an EC2 instance, would that EBS root volume persist? Only if I specify (using either the AWS Console or the CLI) that it should do.
- I can use the AWS Console to add a role to an EC2 instance after that instance has been created and powered-up. TRUE
-
Can you attach an EBS volume to more than one EC2 instance at the same time? No.
-
To help you manage your EC2 instances, you can assign metadata in the form of TAGS.
- In order to enable encryption at rest using EC2 and Elastic Block Store, you must configure encryption when creating the EBS volume.
- Can I move a reserved instance from one region to another? No.
- You need to know both the private IP address and public IP address of your EC2 instance. You should retrieve the instance Metadata from http://169.254.169.254/latest/meta-data.
- EBS volumes are block-based storage.
- If an Amazon EBS volume is an additional partition (not the root volume), can I detach it without stopping the instance? Yes. Although it may take some time.
- You can add multiple volumes to an EC2 instance and then create your own RAID 5/RAID 10/RAID 0 configurations using those volumes. TRUE
- Individual instances are provision in Availability Zones (AZs).
- Spread Placement Groups can be deployed across multiple Availability Zones? TRUE
- Is it possible to perform actions on an existing Amazon EBS snapshot? Yes, through the AWS APIs, CLI, and AWS Console.
- The use of a cluster placement group is ideal when your fleet of EC2 instances requires high network throughput and low latency within a single availability zone.
- EBS Snapshots are backed up to S3 in what manner? Incrementally.