EC2 Flashcards

1
Q

What are the four ways to pay for EC2?

A

On-Demand
Reserved
Spot
Dedicated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Conditions on payment for termination of a Spot EC2 instance

A

If the customer terminates the instance, they pay for the hour. If AWS terminate the instance, Amazon pays for the hour.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What’s is the scope of an AMI? (Global, regional…)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a more secure alternative to storing access keys on EC2 instances?

A

Roles are more secure and easier to manage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How many IAM roles can be associated with an EC2 instance?

A

You can only associate one IAM role with an EC2 instance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When can a role be assigned to an EC2 instance?

A

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”).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the URL to get instance metadata?

A

http://169.254.169.254/latest/meta-data/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the URL to get user data?

A

http://169.254.169.254/latest/user-data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Using the console, can I add a role to an EC2 instance after the instance has been launched?

A

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).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Can I change permissions to a role, even if that role is already assigned to an existing EC2 instance?

A

Yes. These changes will take effect immediately.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Do EC2 instances need to be restarted to apply changes to Security Groups?

A

No, changes to Security Groups take effect immediately.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Is it possible to use the same Security Group in several EC2 instances?

A

Yes. You can have any number of EC2 instances within a Security Group.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Can an EC2 instance use multiple Security Groups?

A

Yes. You can have multiple Security Groups attached to EC2 instances.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Can you specify Deny rules using Security Groups?

A

No, Security Groups deny everything by default. You can only specify Allow rules.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does it mean that Security Groups are STATEFUL?

A

If you create an inbound rule allowing traffic in, that traffic is automatically allowed out again.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the default traffic allowances for the default VPC Security Group?

A

The default VPC Security Group has an inbound all traffic rule from itself. So, all instances in this security group can communicate with them. It has also the usual all outbound traffic enabled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How are instances monitored by ELB reported?

A

InService or OutOfService

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How can I run a configuration script during launch?

A

You can specify User Data to run a configuration script during launch. When creating: Advanced Details -> User Data (during instance creation). In runtime: Actions -> Instance Settings -> View/Change User Data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What types of Placement Groups exist?

A
  • Cluster Placement Group: Low network latency, high network throughput
  • Spread Placement Group: Individual critical EC2 instances
  • Partition Placement Groups: Multiple EC2 instances; HDFS, HBase, and Cassandra.
20
Q

If an Amazon EBS volume is an additional partition (not the root volume), can I detach it without stopping the instance?

A

Yes, although it may take some time.

21
Q

Can the public IP address of an EC2 instance be managed in the instance?

A

No. The public IP address is not managed in the instance. It is instead ana lias applied as a NAT of the private IP address. It can not be managed via instance meta-data.

22
Q

Which are the possible values for the “tenancy” attribute of an instance?

A
  • default: your instance runs on shared hardware.
  • dedicated: your instance runs on single-tenant hardware.
  • host: your instance runs on a Dedicated Host, which is an isolated server with configurations that you can control.
23
Q

What amount of access should be given to users?

A

Always give your users the minimum amount of access required to do their job

24
Q

Can policies attached to roles be updated? When do the changes take effect?

A

You can update a policy attached to a role, and it will take immediate effect

25
Q

Can roles be detached or attached to running EC2 instances?

A

You can attach and detach roles to running EC2 instances without having to stop or terminate those instances

26
Q

How are role permissions controlled?

A

Policies control a role’s permissions

27
Q

When do changes to security groups take effect?

A

Changes to security groups take effect immediately

28
Q

How many EC2 instances can share a security group?

A

You can have any number of EC2 instances within a security group

29
Q

How may security groups can be attached to an EC2 instance?

A

You can have multiple security groups attached to EC2 instances

30
Q

In a security group, is inbound traffic blocked or allowed by default?

A

All inbound traffic is blocked by default

31
Q

In a security group, is outbound traffic blocked or allowed by default?

A

All outbound traffic is allowed

32
Q

What is a bootstrap script?

A

A bootstrap script is a script that runs when the instance first runs. It passes user data to the EC2 instance and can be used to install applications as well to do updates and more.

33
Q

What is user data in the context of EC2?

A

User data are simply bootstrap scripts

34
Q

What is metadata in the context of EC2?

A

Metadata is data about the EC2 instance. You can use bootstrap scripts (user data) to access metadata

35
Q

What are the networking devices available in EC2?

A
  • ENI
  • EFA
  • Enhanced networking
36
Q

What is a scenario for using ENI?

A

For basic networking. Perhaps you need a separate management network from your production network or a separate logging network, and you need to do it at a low cost. In this scenario, use multiple ENIs for each network.

37
Q

What is a scenario for using EFA?

A

For when you need to accelerate High-Performance Computing (HPC) and machine learning applications or if you need to do an OS bypass. If you see a scenario question mentioning HPC or ML and asking what network adapter you want, choose EFA.

38
Q

What is a scenario for using Enhanced Networking?

A

For when you need speeds between 10 Gbps and 100 Gbps. Anywhere you need reliable, high throughput.

39
Q

Which placement groups can span multiple AZ? Which can’t?

A

A cluster placement group can’t span multiple AZs. A spread and partition placement group can.

40
Q

Can any type of instance be launched in a placement group?

A

No. only certain types of instances can be launched in a placement group (compute optimised, GPU, memory optimised, storage optimised)

41
Q

Can placement groups be merged?

A

No, you can’t merge placement groups.

42
Q

Can you move an existing instance into a placement group?

A

You can move an existing instance into a placement group. Before you move the instance, it must be in the stopped state. You can move or remove an instance using the AWS CLI or the AWS SDK, but you can’t do it via the console yet.

43
Q

What EC2 pricing option can you use for special licensing requirements?

A

Dedicated hosts. An Amazon EC2 Dedicated Host is a physical server with EC2 instance capacity fully dedicated to your use. Dedicated Hosts allow you to use your existing per-socket, per-core, or per-VM software licenses, including Windows Server, Microsoft SQL Server, and SUSE Linux Enterprise Server.

44
Q

Can you block Spot instances from terminating?

A

You can block Spot Instances from terminating by using Spot block.

45
Q

What is a Spot Fleet?

A

A Spot Fleet is a collection of Spot Instances and, optionally, On-Demand Instances.

46
Q

Up to what percentage of cost can you save by using Spot instances?

A

Spot Instances save up to 90% of the cost of On-Demand Instances.