EC2 Flashcards

1
Q

What are the two default IP’s assigned to an EC2 instance when it is stood up in (assuming a route to internet)

A

Public (www)

Private (AWS network)

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

How many IAM roles can be attached to an EC2 instance at once?

A

One

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

Are ENI’s global?

A

No, they are bound to an AZ

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

What is the role of the Ec2 spot advisor?

A

Spot advisor can provide configuration profiles which can either be directly applied to the spot fleet or customised and then applied to the fleet.

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

Are you charged for an elastic IP associated against a
-Running
-Non Running
EC2 instance?

A

You are charged when you have an EIP associated with a non running instance.

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

Can you detach an instances primary ENI?

A

No

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

How many elastic IP’s can you have per account in AWS?

A

5 - but you can request more.

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

When connecting to an Ec2 instance - you receive a connection time out. Why is this and what is the fix?

A

Port 22 is not open on the instances security group. You will need to open the port by creating an inbound rule on the instances security group.

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

What placement group allows for the highest availability and what are the limits of that group?

A

Spread. All instances are on different hardware. Limits are that you can only have 7 instances per group. Use for critical apps where each instance needs to be isolated from other instances.

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

You are ssh’ing into an ec2 instance using a pem file. You get an error stating the key file has bad permissions. What do you need to do?

A

You need to change the permissions of the key file using chmod 0400

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

If I have an instance with 3 ENI’s , how many private IP addresses will I have on that instance?

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

Does an ENI need to be attached to an instance?

A

No. ENI’s can be created separately to an instance.

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

How could you use an elastic IP to mask an instance failure?

A

You would remap the EIP from the failed instance to a working component. Its a hack, and the architecturally robust method is to use a load balancer and health checks.

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

If a spot instance is killed by by AWS in your first billing hour, how much do you pay?

A

Nothing if AWS kills the instance rather than you.

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

When is an EC2 UserData bootstrap script run?

A

On FIRST boot of the ec2 instance. Its is run once and only once

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

Under which account are EC2 userdata bootscripts run?

A

root.

17
Q

Over what time period can you reserve a dedicated HOST for? Why would you use one?

A

3 years. Typically you would use one when you need to either control instance placement or need visibility of sockets and cores (usually bring your own licensing models). Also used if you have strong regulatory needs.

18
Q

What happens to an instances public IP when the instance is restarted? What happens to the private IP?

A

The public IP will most likely change. The private IP is stable though and won’t.

19
Q

How many instances at a time can an elastic IP be attached to?

A

One

20
Q

I have an ENI with a private IP if 23.345.102.16. If I attach this to an instance, what will the private IP be for that instance?

A

23.345.102.16 - the same. Attributes of an ENI follow it as its attached or detached.

21
Q

When you launch an instance, what are the tenancy options you can choose from?

A

Dedicated Instance
Dedicated Host
Share host

22
Q

What happens to the attributes of an ENI if it is detached from one instance and attached to a new instance?

A

The attributes of a network interface follow it as it’s attached or detached from an instance and reattached to another instance. When you move a network interface from one instance to another, network traffic is redirected to the new instance.

23
Q

what is eth0 with respect to a linux EC2 instance

A

Its your primary virtual network interface

24
Q

What is an EC2 Userdata bootstrap script used for?

A

Automating boot tasks on an EC2 Instance on instance first start - updates, software installs etc. The more tasks are in the boot script, the longer it will take for the instance to start

25
Q

If we have a web application which has a reasonably steady baseline workload throughout the year, but with some peaks, what combination of EC2 instances could you use?

A

You could provision reserved instances for the baseline periods, and then scale out using either spot or on demand instances to process the peaks.

26
Q

For a reserved instance, there are 3 types of payment options. What are they? (Hint: Not convertible)

A

No upfront
Partial Upfront
All Upfront

27
Q

Assume you are running a linux Ec2 on demand instance for 45 seconds - how long are you billed for? What if its running for 93 seconds?

A

You are billed per second on linux - with a minimum period of 60 seconds. In the first case you will be billed for 60 seconds. In the second, you will be billed for 93 seconds

28
Q

For a Dedicated instance - will instances from other customers run on the instance?

A

No. Other customers instances will not run on a dedicated instance - but your instances will.

29
Q

Do you pay for T2 micro instance usage in the first 12 months of your AWS account?

A

No, T2 micro usage is free tier within the first 12 months