EC2 Flashcards
What are the two default IP’s assigned to an EC2 instance when it is stood up in (assuming a route to internet)
Public (www)
Private (AWS network)
How many IAM roles can be attached to an EC2 instance at once?
One
Are ENI’s global?
No, they are bound to an AZ
What is the role of the Ec2 spot advisor?
Spot advisor can provide configuration profiles which can either be directly applied to the spot fleet or customised and then applied to the fleet.
Are you charged for an elastic IP associated against a
-Running
-Non Running
EC2 instance?
You are charged when you have an EIP associated with a non running instance.
Can you detach an instances primary ENI?
No
How many elastic IP’s can you have per account in AWS?
5 - but you can request more.
When connecting to an Ec2 instance - you receive a connection time out. Why is this and what is the fix?
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.
What placement group allows for the highest availability and what are the limits of that group?
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.
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?
You need to change the permissions of the key file using chmod 0400
If I have an instance with 3 ENI’s , how many private IP addresses will I have on that instance?
- 1 per ENI.
Does an ENI need to be attached to an instance?
No. ENI’s can be created separately to an instance.
How could you use an elastic IP to mask an instance failure?
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.
If a spot instance is killed by by AWS in your first billing hour, how much do you pay?
Nothing if AWS kills the instance rather than you.
When is an EC2 UserData bootstrap script run?
On FIRST boot of the ec2 instance. Its is run once and only once
Under which account are EC2 userdata bootscripts run?
root.
Over what time period can you reserve a dedicated HOST for? Why would you use one?
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.
What happens to an instances public IP when the instance is restarted? What happens to the private IP?
The public IP will most likely change. The private IP is stable though and won’t.
How many instances at a time can an elastic IP be attached to?
One
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?
23.345.102.16 - the same. Attributes of an ENI follow it as its attached or detached.
When you launch an instance, what are the tenancy options you can choose from?
Dedicated Instance
Dedicated Host
Share host
What happens to the attributes of an ENI if it is detached from one instance and attached to a new instance?
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.
what is eth0 with respect to a linux EC2 instance
Its your primary virtual network interface
What is an EC2 Userdata bootstrap script used for?
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
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?
You could provision reserved instances for the baseline periods, and then scale out using either spot or on demand instances to process the peaks.
For a reserved instance, there are 3 types of payment options. What are they? (Hint: Not convertible)
No upfront
Partial Upfront
All Upfront
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?
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
For a Dedicated instance - will instances from other customers run on the instance?
No. Other customers instances will not run on a dedicated instance - but your instances will.
Do you pay for T2 micro instance usage in the first 12 months of your AWS account?
No, T2 micro usage is free tier within the first 12 months