EC2 Flashcards
What are the four ways to pay for EC2?
On-Demand Reserved Spot Dedicated hosts
Conditions on payment for termination of a Spot EC2 instance
If the customer terminate the instance, he pays for the hour. If AWS terminate the instance, Amazon pays for the hour.
EBS Volume Types
SSD-GP2: General Purpose SSD (up to 10.000 IOPS) SSD-IO1: Provisioned IOPS SSD (up to 20.000 IOPS) HDD-ST1: Throughput Optimized HDD (magnetic. Frequently accessed workloads. No boot. Ex: big data, DWH, log processing) HDD-SC1: Cold HDD (magnetic. Less frequently accessed data. No boot. Lowest cost storage. Ex: File Server) HDD-Magnetic (standard): lowest bootable cost.
On how many EC2 instances can a EBS volume be mounted?
- An EBS volume can only be mounted on one EC2 instance. If you want to use shared disks, use EFS.
What is the status of Termination Protection by default?
Termination Protection is turned-off by default. It must be turned on manually.
What is the default action on the EBS root volume when the instance is terminated?
On an EBS-backed instance, the default action is for the root EBS volume to be deleted when the instance is terminated.
Can root volumes be encrypted?
EBS boot (root) volumes can be encrypted (but not by default). This feature is based on another feature that allows you to copy an EBS snapshot while also applying encryption.
Volumes exist on … and Snapshots exist on ….
EBS and S3
When you take a Snapshot of a Volume, where does the Snapshot is stored?
On S3
Are Snapshots incremental?
Yes. Only the blocks that have changed since your last Snapshot are moved to S3. The first Snapshot may take some time to create.
What are Snapshots?
Snapshots are point in time copies of Volumes. Snapshots are incremental.
If you take a Snapshot of a encrypted Volume, will the Snapshot be encrypted?
Yes. Snapshots of encrypted Volumes are encrypted automatically.
If you restore a Volume from a encrypted Snapshot, will the Volume be encrypted?
Yes. Volumes restored from encrypted Snapshots are encrypted automatically.
Can snapshots can be shared?
Yes, but only if they are unencrypted. The Snapshots can be shared with other AWS account or made public.
What happens with the EC2 instance if you take a Snapshot of its EBS boot (root) Volume?
You can take a snapshot of an attached volume that is in use (although you should probably better stop it before). However, snapshots only capture data that has been written to your Amazon EBS volume at the time the snapshot command is issued. AWS will not reboot or stop the instance.
Instance Store volumes are also known as…
Ephemeral Storage
What happen if you stop an Instance Store instance?
The data in the Instance Store volumes will be lost
What is the difference between Instance Store volumes backed instances and EBS backed instances at Shutdown (Stop) time?
Instance Store backed instances cannot be stopped (only rebooted or terminated). EBS backed instances can be stopped without losing data.
What is the difference between Instance Store volumes backed instances and EBS backed instances at Reboot time?
Nothing. Both instance types can be rebooted without problems.
What happen if you reboot an Instance Store instance?
Nothing. An Instance Store backed instance can be rebooted without problems.
What happen to Instance Store and EBS boot (root) volumes when the instance is terminated?
By default, both root volumes will be deleted on termination. However with EBS volumes, you can tell AWS to keep the root device volume.
How do you tell AWS to keep an EBS root volume after terminating the instance?
Using the console, you can configure the DeleteOnTermination attribute when you launch an instance. To change this attribute for a running instance, you must use the command line.
How can I take a Snapshot of a RAID array?
Due to interdependencies of the array, there can be problems doing a hot Snapshot because of data held in cache by applications and the SO. To solve this, and application consistent snapshot must be taken. That is, stop the applications from writing to disk and flush all caches to disk. This can be done freezing the filesystem, unmounting the array or, more easily, shutting down the associated EC2 instance.
What’s is the scope of an AMI? (Global, regional…)
AMI’s are regional. An AMI can only be launched from the region in which is stored. However, AMI’s can be copied to other regions using the console, CLI or AWS EC2 API.
What are the time periods for standard and detailed monitoring?
Standard monitoring: 5 minutes Detailed monitoring: 1 minute
What is CloudWatch for?
CloudWatch is for performance monitoring. Don’t confuse it with CloudTrail (which is for auditing)
What can be done with CloudWatch?
Dashboards Alarms Events Logs Metrics (view)
What is a more secure alternative to storing access keys on EC2 instances?
Roles are more secure and easier to manage
How many IAM roles can be associated with an EC2 instance?
You can only associate one IAM role with an EC2 instance.
When can a role be assigned to an EC2 instance?
The role can be assigned at creation time or assigned/replaced/unassigned in runtime (Actions -> Instance Settings -> Attach/Replace IAM role, Select role or “No Role”). Previously, roles could be assigned only when the EC2 instance was launched (that is when it was being provisioned).
What’s is the scope of Roles? (Global, regional…)
Roles are global.
What is the URL to get instance metadata?
http://169.254.169.254/latest/meta-data/
What is the URL to get user data?
http://169.254.169.254/latest/user-data
What protocol does EFS support?
NFSv4
What are the storage limits of an EFS volume?
Can scale up to petabytes.
How many concurrent connections does an EFS volume supports?
Thousands of concurrent connections.
How is EFS data stored? (one AZ, multiple AZ, …)
Data is stored across multiple AZ’s within a region
What is the consistency model of EFS?
Read after Write consistency
What is Lambda?
AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the underlying compute resources for you.
How can be Lambda used?
As an event-driven compute service As a compute service to run your code in response to HTTP requests using Amazon API Gateway or API calls using AWS SDKs.
Can I delete a snapshot of an EBS volume that is used as the root device of a registered AMI?
No. You can’t delete a snapshot of the root device of an EBS volume used by a registered AMI. You must first deregister the AMI before you can delete the snapshot.
Can a (Clustered) Placement Group be deployed across multiple AZs?
No.
What is the command line command to create a snapshot?
ec2-create-snapshot
Can you attach an EBS volume to more than one EC2 instance at the same time?
No
A (Clustered) placement group is ideal for…
EC2 instances that require high network throughput and low latency across a single AZ.
Using the console, can I add a role to an EC2 instance after the instance has been launched?
Yes. Roles can be assigned/replaced/unassigned using the console after the instance has been launched (Actions -> Instance Settings -> Attach/Replace IAM role, Select role or “No Role”). Previously, roles could be assigned only when the EC2 instance was launched (that is when it was being provisioned).
Can I change permissions to a role, even if that role is already assigned to an existing EC2 instance?
Yes. These changes will take effect immediately.
What does EBS stands for?
Elastic Block Store
What is Amazon EBS?
Amazon Elastic Block Store (Amazon EBS) provides persistent block storage volumes for use with Amazon EC2 instances in the AWS Cloud. Each Amazon EBS volume is automatically replicated within its Availability Zone to protect you from component failure, offering high availability and durability.