General Flashcards
What is one serverless AWS service for noSQL and one for SQL databases?
DynamoDB & Aurora Serverless
If you want to run a custom container image on Lambda what needs to be implemented in the image and what other services should be used if it isn’t in the image?
Lambda Runtime API. ECS or Fargate can be used to run the image in a container on the cloud instead of Lambda.
Is the maximum size of a DynamoDB item:
- 4 KB
- 400 KB
- 4 MB
- 40 MB
400 KB
T or F: API Gateway supports WebSocket protocol
TRUE
What 2 CLI commands are used to package & deploy a SAM template?
sam package & sam deploy
Why kind of header is used to indicate a cloudformation is a SAM template?
a Transform header: Transform: AWS::Serverless-2016-10-31
What 3 resources are specific to SAM templates?
AWS::Serverless::(Function, Api, SimpleTable)
What service can be used if a custom domain or HTTPS is desired for an AppSync endpoint?
CloudFront
What is used as an initial bootstrap script for EC2 instances?
EC2 User Data
T or F: EBS volumes are shared across availability zones
FALSE
T or F: Taking a snapshot of an EBS volume requires detaching it from any EC2 instances
FALSE but it is recommended to do so to get a clean snapshot.
What is one reason you would create a custom AMI instead of using EC2 User Data for environment setup?
The initial boot time when an EC2 is started is significantly reduced when using an AMI instead of EC2 User Data.
Why would someone choose an EC2 instance store over an EBS volume? What is a downside to using an instance store?
Better IOPS throughput/performance (~10ks vs ~100ks-1,000ks) but it is ephemeral storage (i.e. nothing is saved when instance stops running). This creates a risk of data loss if the hardware fails.
What are the 3 major types of EBS volume?
General Purpose SSD (gp3 & gp2), Provisioned IOPS SSD (io2 & io1), & Throughput Optimized (st1) and Cold (sc1) HDD.
If a Provisioned IOPS SSD EBS volume is being used what additionally is required to increase the max IOPS above 32K?
Nitro EC2 instance will increase the max to 64K
What EBS volume types support multi-attach?
Provisioned IOPS SSD (io1 & io2)
T or F: EFS can be used on Windows AMIs
FALSE only supports Linux AMIs
What 2 performance modes are available for an EFS on creation time and what are their pros and cons?
General Purpose: low latency
Max I/O: higher latency but higher throughput
What 2 throughput modes are available for an EFS and what are their pros and cons?
Bursting: storage/throughput ratio is set at 1TB/50MiB/s w/ burst up to 100MiB/s
Provisioned: set any throughput regardless of how much storage exists
What 2 storage tiers are available for an EFS?
Standard: free to retrieve Infrequent Access (EFS-IA): cost to retrieve, lower storage price
What are the 3 types of ELB and what web protocols do they support?
Classic (v1, Layer 4 or 7): HTTP, HTTPS, TCP
Application (v2, Layer 7): HTTP, HTTPS, WebSocket
Network (v2, Layer 4): TCP, TLS (secure TCP), UDP
What are the possible target groups for an Application Load Balancer?
EC2 instances (could also be an ASG) ECS tasks Lambda functions (HTTP translated to JSON) IP Addresses (only private IPs)
How would an ALB target group get a client’s IP, protocol, or port?
HTTP headers: X-Forwarded-(For | Port | Proto)
List 3 reasons why an NLB would be chosen over an ALB
lower latency: ~100ms vs ~400ms
better scalability: millions of request/s
static IP per AZ: useful for IP whitelisting
I have an NLB with an EC2 target group. The EC2 security group only allows inbound traffic from the NLB’s security group but traffic is being denied. What is wrong?
an NLB preserves the incoming traffic’s IP and protocol when forwarding traffic so the EC2 security group needs to allow inbound traffic from all IPs.
What 2 ELB types are compatible with sticky sessions?
Classic & Application load balancers
What are the 2 basic types of cookies used for ELB sticky sessions and what are some reasons why one would be chosen over the other
Application-based cookies:
- can be custom, target generated with any
custom attributes with custom cookie name for
each target group
- expiry can be set by the application
Duration-based cookies
- expiry can be set by the load balancer
For which ELB type/s is it possible to disable cross-zone load balancing?
NLB & CLB
What is Server Name Indication used for and for what services is it compatible?
Allows loading multiple SSL certs for a single web server so a single server can route traffic to multiple target groups with different SSL certs.
Requires client to specify hostname of target server on initial SSL handshake
ELB: ALB & NLB (not CLB)
Cloudfront
What is a ‘deregistration delay’ used for on ALB/NLB’s?
When a target group enters ‘draining’ mode as a prelude to shutting down it is the maximum time this mode is sustained in which time the EC2 instance is handling existing connections while the balancer does not send any extra traffic. Can be 0-3600 seconds. default is 300.
This is used to make sure an EC2 isn’t terminated in the middle of handling a request for an ALB/NLB.
How are scaling actions triggered for ASGs? List some metrics that can be used to trigger these.
CloudWatch alarms
- average CPU usage
- # of requests per instance
- average Network throughput In or Out
- a preset schedule
What is used to launch an ASG?
Launch Configuration or the newer Launch Template
If an EC2 instance in an ASG becomes unhealthy will it be restarted or terminated and a new instance launched?
terminated & new instance launched