All Flashcards
(231 cards)
IAM Policy Structure
Version: 2012-10-17
ID (optional): identifier for the policy
Statement: one or more individual statements
Statement consists of:
- Sid: identifier for the statement (optional)
- Effect: whether the statement allows or denies access
- Principal: account/user/role to which applied
- Action: list of resources to which actions are applied
- Condition: condition for when the policy is in effect (optional)
What is the issue for the following errors:
- Your application is not accessible and you get a “timed out” when trying to access it.
- If your application gives a “connection refused” error
- Security Group issue
2. Application error, or it’s not launched (security group worked)
What are these Ports? 21 22 80 443 3389
21 - FTP (File Transfer Protocol) - upload files into a file share
22 - SSH (Secure Shell) - log into Linux instance, but also SFTP (Secure File Transfer Protocol) - upload files using SSH
80 - HTTP access to unsecured website
443 - HTTPS access to a secured website
3389 - RDP (Remote Desktop Protocol) - log into a Windows Instance
How to connect to Linux EC2 using PowerShell?
ssh -i PathTo.pemFile ec2-user@PublicIpAddressOfInstance
Pros and Cons of Cluster Placement Group - All instances on the same server rack in same AZ
Pros: Great Network - 10Gbps bandwidth between instances
Cons: If the rack fails, all instances fail at the same time
Use Case: Big data job that needs to complete fast or app that needs extremely low latency and high network throughput
Pros and Cons of Spread Placement Group - All instances are located on different racks/hardware, and across AZs
Pros: Can spread across AZs for reduced risk of simultaneous failure.
Cons: Limited to 7 instances per AZ per placement group
Use Case: App that needs to maximize high availability and critical apps where each instance must be isolated from failure from each other
Pros and Cons of Partition Placement Group - Each partition is a rack and each partition can have multiples in each AZ and spread across multiple AZ.
Pros: Up to 7 partitions per AZ and can spread across multiple AZs (within the same region) for up to 100s of instances. Don’t share the same hardware so a failure isn’t catastrophic
Use Cases: Big Data apps
What is an ENI?
Elastic Network Interface - acts as virtual network card and is a component of the VPC
They are bound to a specific AZ
What is EC2 Nitro?
New underlying platform for EC2 instances.
Will have higher speed EBS, better security, better networking
Why would you want to change the default vCPU options?
Sometimes licensing is charged based on number of cores. So the default of 2 threads per core and 8 cores (which would be 16 vCPU) could cost a lot. So if you want to keep the same amount of RAM, but don’t need all those vCPU, you can disable multithreading (allow just 1 thread per core) and lower the amount of overall cores to lower the cost of the licensing charges
EBS MultiAttach
Usually an EBS volume can only be attached to ONE ec2 instance at a time. However, with io1/io2 family EBS Volumes, you can attach these to multiple instances within the same AZ.
Which can be mounted in multi AZ?
EFS or EBS
EFS
Can Windows instances have an EFS mounted?
No. Only for Linux
EFS Performance Modes
General Purpose - latency sensitive use cases (web servers)
Max I/O - higher latency, throughput, highly parallel (big data, media processing)
EFS Throughput Modes
Bursting - 1TB = 50MiB/s + burst of up to 100MiB/s
Provisioned - set your throughput regardless of storage size (ex: 1GiB/s for 1TB storage)
What layer is TCP? HTTP? HTTPS? Network?
Network = Layer 3
TCP = Layer 4
HTTP and HTTPS = Layer 7
What protocol and on which port does the Gateway Load Balancer use?
GENEVE protocol on port 6081
Sticky Sessions
This mean that a client accessing an EC2 instance through a load balancer will be directed to the same EC2 instance every time. This is done via a “cookie”. The cookie will expire eventually, and the client will be directed to whichever instance the load balancer sees fit if it is a duration based cookie. You can also create your own without an expiry date
Which load balancer always has Cross Zone Load balancing?
Application Load Balancer. There are no charges for inter-AZ data transfer
It can be enabled for NLB and CLB. Only NLB will charge you for inter-AZ data transfer.
What is SNI (Server Name Indication)?
SNI solves the problem of loading multiple SSL certificates onto one web server (to serve multiple websites)
It’s a newer protocol and requires the client to indicate the hostname of the target server in the initial SSL handshake
Only works for ALB & NLB or CloudFront (not CLB)
In other words, you can have an ALB or NLB balance traffic between 2 different websites at once. When a user wants to access one of the websites, it will use SNI to tell the load balancer which site they want, so the load balancer can select the right SSL certificate, and encrypt the traffic to the correct site
Connection Draining/Deregistration Delay
If using a CLB, it is called Connection Draining. If using an ALB or NLB, it is called Deregistration Delay
This is a setting on an EC2 instance where once it becomes unhealthy, it doesn’t shutdown right away. The load balancer will stop routing new traffic to it, but for the traffic that has already been routed to it, the draining time will allow those people time to finish their task before the instance shuts down. Default is 300 seconds. Can go up to 3600 seconds.
Which is becoming legacy and which is new between “Launch Configuration” and “Launch Template”? (used for auto scaling groups)
Configuration is legacy, template is newer
You are using an Application Load Balancer to distribute traffic to your website hosted on EC2 instances. It turns out that your website only sees traffic coming from private IPv4 addresses which are in fact your Application Load Balancer’s IP addresses. What should you do to get the IP address of clients connected to your website?
When using an Application Load Balancer to distribute traffic to your EC2 instances, the IP address you’ll receive requests from will be the ALB’s private IP addresses. To get the client’s IP address, ALB adds an additional header called “X-Forwarded-For” contains the client’s IP address.
Application Load Balancers can route traffic to different Target Groups based on the following, EXCEPT:
Client Location
Hostname
Request URL Path
Source IP Address
Client Location. ALBs can route traffic to different Target Groups based on URL Path, Hostname, HTTP Headers, and Query Strings.