Domain 3: Development with AWS Services Flashcards

1
Q

What is the maximum processing time of an AWS Lambda function?

A

Maximum processing time of 15 mins (cannot be increased)

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

What is the maximum lambda concurrent executions?

A

1000 (can be increased by opening a support ticket)

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

What are Lambda “layers” used for?

A

Additional code (libraries or custom runtime) in a .zip format for your lambda function to use.

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

What are some of the serverless AWS services available?

A

Lambda, dynamodb, API Gateway, S3, SQS, SNS, Step functions and CloudWatch Events

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

What is Lambda?

A

A serverless Function-as-a-Service (FaaS) event driven service

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

How to refer to Lambda function versions?

A

Unqualified ARN -
arn:aws:lambda:aws-region:acct-id:function:helloworld
Refers to the $LATEST “helloworld” version

Qualified ARN -
arn:aws:lambda:aws-region:acct-id:function:helloworld:42
Refers to version 42 of the helloworld function

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

What is AWS API Gateway?

A

AWS serverless service for managing HTTP, SOAP, REST traffic at scale

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

What languages are supported by AWS Lambda?

A

Go, C#, Python, Nodejs

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

What are the main AWS HTTP status codes and their meanings?

A

2xx - Success
4xx - Client error
5xx - Server side errors

400 - Bad request
401  - Unauthorized
403 - Forbidden/access denied
404 - Resource not found
409 - Conflict
429 - TooManyRequests

500 - Internal Server Error
503 - Service is unavailable

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

What are the DynamoDB primary key types?

A

Partition key - Unique item attribute

Composite key - Partition + sort key (partition and sort key combo have to be unique)

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

What are the different types of a DynamoDB secondary index?

A

Local Secondary Index

  • Same partition key as primary but different sort key
  • Can only create at same time table is created

Global Secondary Index

  • Different partition and sort key
  • Create at any time
  • Eventual consistency only
  • Own provisioned WCU/RCU
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the quota for secondary indexes per table?

A

5 Local secondary indexes

20 Global secondary indexes per table (can be increased)

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

What is a WCU and RCU?

A

1 WCU = 1 x 1 kB write per second
1 RCU = 1 x 4 kB strongly consistent reads per second OR
2 x 4 kB eventually consistent reads per second

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

What are some of the ways to reduce a query time with dynamodb?

A
  1. –projection-expression : To only retrieve the attributes of each item that is needed
  2. Increase the WCU/RCU
  3. –page-size : To paginate the number of items per page
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are some of the ways to increase a scan speed to dynamodb?

A
  1. –projection-expression : To only retrieve the attributes of each item that is needed
  2. Increase the WCU/RCU
  3. –page-size : To paginate the number of items per page
  4. Performing a parallel scan on the dynamodb table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the supported documents of a dynamodb table?

A

HTML, XML or JSON

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

How is access managed to dynamodb?

A

IAM policies, access can be granted on a per item basis as well

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

What are the main db caching services?

A

DAX - DynamoDB accelerator, only for dynamodb

Elasticache - In memory caching

Both sit between the application and the database

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

What is the Lazy Loading caching strategy?

A

Lazy Loading - Loads data into the cache only when necessary

  • Set the TTL to reduce stale data
  • Little wasted resources
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the “Write through” caching strategy?

A

Adds or updates data to the cache whenever data is written to the db

  • Write penalty
  • Wasted resources when data isn’t read
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How does dynamodb support ACID?

A

DynamoDB transactions: Multiple reads or writes which either fails or succeeds

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

What is DynamoDB streams?

A

A time ordered sequence of item level modifications on a dynamodb table which can trigger a Lambda function

Data is stored for 24 hrs

Before and after item images can be captured

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

What is EFS?

A

EFC - Elastic File System: Simple and scalable file storage to be used with EC2

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

What is AWS RDS?

A

AWS Relational Database service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How to enable encryption on an AWS RDS instance?
Create a snapshot and deploy that snapshot encrypted
26
What are the main in-memory elasticache methods?
Memcached & Redis for sub-millisecond latency with in-memory caching
27
What are the main differences between Redis & Memcached?
Memcached is great for simplicity, while Redis is great for persistence, complex data structures and ACID transactions
28
What are the main AWS DynamoDB commands & their meanings?
aws dynamodb get-item # Get a single item in a table aws dynamodb put-item # Write a single item aws dynamodb batch-get-item # Get multiple items aws dynamodb batch-write-item # Write multiple items
29
A DynamoDB call returns a "unprocessedKeys" value to your query, what are some of the reasons this could be and how are the remediated?
1. The total data returned exceeds 16 MB - paginate your returned results 2. The table provisioned throughput has been exceeded - Retry the remaining batch get operation with the exponential backoff algorithm
30
What are the attribute types of a DynamoDB item?
String (S), Number (N) or Binary (B)
31
What are the main AWS messaging services?
SQS - Simple Queue Service SNS - Simple Notification Service SES - Simple Email Service
32
What are the SQS queue types and their uses?
Standard - Not guaranteed to be ordered and may be delivered more than once but most efficient FIFO - Guaranteed to be ordered and delievered only once
33
What is the maximum message size in a SQS queue?
256 kB
34
How do you deliver messages that are very large with SQS?
Using S3 with the "Extended Client Library for Java" up to a maximum of 2 GB
35
What is the SQS visibility timeout?
It is a period of time from when a consumer consumes a message during which other consumers cannot receive and process the message. Once the consumer has successfully processed a message it should delete it from the queue
36
What is the SQS visibility timeout default value?
30 s
37
What is the SQS visibility timeout minimum value?
0 s
38
What is the SQS visibility timeout maximum value?
12 hrs
39
What is the SQS message retention period?
The time a message is permitted to remain in a SQS queue
40
What is the SQS message retention period default value?
4 days
41
What is the SQS message retention period minimum value?
60 s
42
What is the SQS message retention period maximum value?
14 days
43
What is the AWS SQS delay queue?
Allows the producer of message to make a message invisible on the queue for a period of time before a consumer can read it
44
What is the AWS SQS minimum SQS delay time?
0 s
45
What is the AWS SQS default SQS delay time?
0 s
46
What is the AWS SQS maximum SQS delay time?
15 mins
47
What is the main difference between SQS & SNS?
SQS is pull-based & SNS is push-based
48
What is SNS?
A pub/sub aws managed service
49
What are the main protocols of SNS?
SQS, Lambda, HTTP, email, mobile push notifications & mobile SMS
50
How can you deliver to multiple SQS queues?
With fanout - Publish to an SNS topic with SQS queues as the subscribers
51
What is SQS long polling and short polling?
Short polling immediately returns a response if the queue is empty, while long polling will wait a given time (max 20 s) for a message to appear. Long polling is cheaper and more efficient CPU wise
52
What is the best way to prioritise messages with SQS?
Have a priority queue and a lower priority queue. Have the client poll the priority queue and if it is empty check the lower priority queue.
53
What is DynamoDB TTL?
Time To Live defines an expiry time for your data, once item is expired the item is marked for deletion, item will be deleted within 48 hrs Automatically removes data which is no longer relevant. Reduces cost.
54
What is ECS?
Elastic Container Service - A managed container orchestration service which supports: docker & windows containers
55
What is AWS Fargate?
AWS Fargate is a serverless compute engine for containers which is integrated with ECS & EKS
56
What is EKS?
Amazon Elastic Kubernetes Service - gives you the ability to start, run & scale Kubernetes applications for managing multiple containers
57
What is ECR?
Elastic Container Registry - A registry of container images ECS connects to ECR to deploy your application
58
What are the deployment options for containers?
ECS can run your containers on either: Clusters of virtual machines Fargate for serverless containers
59
What is a container?
A container is a virtual operating environment with everything the software needs to run
60
Outline the steps of deploying a docker application with CodeCommit, CodeBuild & ECS
1 Application code is stored in CodeCommit with the "buildspec.yml" & "Dockerfile" at the root of the directory 2. CodeBuild uses the CodeCommit repo together with the buildspec.yml file to create the Docker image 3. CodeBuild pushes the docker image to the ECS
61
What is the docker command for building a docker image?
docker build -t myimagerepo (local file path of your docker application)
62
What is the docker command for tagging a docker image?
docker tag myimagerepo:lastest (account #).dkr.ecr.(aws region).amazonaws.com/myimagerepo:latest
63
What is the docker command for pushing a docker image?
docker push (account #).dkr.ecr.(aws region).amazonaws.com/myimagerepo:latest
64
How can you configure API gateway?
Swagger (.yml) configuration files, can also be used with an SDK
65
How can you prioritise or throttle requests from certain clients?
Handout API keys to clients and throttle the request rate based on this.
66
What is AWS Kinesis?
A collection of services which enables you to collect, process & analyse data in real time
67
What are the three core kinesis services?
Kinesis Streams - Data & video streams Kinesis Data Firehose - Capture, transform, load data into data stores Kinesis Data Analytics - Analyze, query & transform data using standard SQL
68
What is Kinesis Streams?
Kinesis streams are made up of shards | each shard is a sequence of one or more data records
69
How do you increase the data capacity of Kinesis streams?
Increase the number of shards
70
What happens to the data in Kinesis firehose?
Data is collected from multiple producers and either picked up by lambda or stored directly in S3, Redshift or ElasticSearch
71
How should you scale the number of consumers of a kinesis stream?
Number of instances shouldn't exceed the number of shards (except failover) One consumer/worker can process multiple shards Only need to increase consumers based on CPU utilization
72
What is the API G/W steady-state default request rate limit set to?
10,000 requests per second
73
What is the maximum concurrent requests permitted for API G/W?
5000 requests across all APIs in a single AWS account
74
A client receives a 429 HTTP error from an API G/W service what are the possible reasons for this?
1. The stready state default request rate has exceeded the default 10,000 requests permitted 2. You have gone over the 5000 concurrent requests
75
What is the API G/W SOAP web service passthrough?
Passthrough XML (or another unsupported format) to the backend without transformation
76
What are the supported API types for API G/W?
HTTP, REST or WebSocket API
77
What are some of the ways of streaming realtime data between a client and a server?
AWS Appsync or websockets
78
In API G/W what are stages and stage variables?
Similar to tags, they define a specific version of your API The stage variables (are like environment variables) are key/value pairs used in your API. For example, you can define the HTTP endpoint as a stage variable so that you don't have to hardcode the endpoint and you can experiment with different combinations
79
What is the minimum memory of AWS Lambda?
128 MB
80
What is the maximum memory of AWS Lambda?
10 GB
81
What is the minimum timeout value for a Lambda function?
1 second
82
How can Lambda be triggered from a CloudWatch Alarm?
Configure the alarm to send an SNS notification on a topic and select a Lambda function and associate it with that topic
83
What are the different ways of triggering a Lambda function?
Using "Event sources" that produces events to trigger an AWS Lambda function to run Some resources Lambda has to poll (SQS queues Kinesis streams) others invoke lambda directly (S3 or your own service).
84
What are the main ways of running lambda functions?
Docker containers or ZIP archives
85
What are Websocket APIs?
Websocket APIs are bidirectional - A client can send messages and services can send messages to the client independently. This is in contrast to REST/SOAP where the client has to explicitly send a read request to the server.
86
What is AWS AppSync?
AWS AppSync is a service for developing GraphQL APIs for combining multiple datasources. It also uses Websockets to push real-time data to clients.
87
Are AMIs region specific?
Yes but you can copy an AMI across regions
88
What is an SQS dead letter queue?
An SQS queue to put items that cannot be consumed
89
When it an item put into an SQS dead letter queue?
When the "receiveCount" exceeds the "maxReceiveCount"
90
Is S3 eventually consistent?
Only for PUT (new items) or DELETE operations
91
In CloudFormation, how does one refer to keys within a map?
{"Fn:FindInMap" : [ "MapName", "TopKey", "SecondKey"]}
92
In the CloudFormation mappings section in the template can you refer to parameters?
No
93
In CloudFormation what is the Ref intrinsic function and how is it used?
It is used to return the value of a parameter or a resource name. It is used as follows: { "Ref" : "logicalName" }
94
What is pessimistic concurrency and optimistic concurrency?
Pessimistic concurrency - item locked to prevent change | Optimistic concurrency - Check item upon save to ensure it has not changed
95
How does dynamodb use optimistic concurrency?
Using conditional writes - Only updates an item if a given condition is true
96
What is Amazon SWF?
Amazon Simple Workflow service - great for managing workflows across different components
97
You have exceeded an account limit, how can you increase this?
Use the support center within the AWS Management Console
98
What is a better database caching solution for high availability - Redis or Memcached?
Redis - data is persisted and replicated across multiple AZs/nodes. Memcached does not support replication or persistance
99
How can a developer be notified when there are new objects uploaded to S3?
Add an event to S3 for all new POST/PUT operations and use an SNS topic
100
When should you use AWS SWF or step functions?
Step functions should be considered for all new applications as it is agile. In some cases consider AWS SWF if you require external signals to intervene with your workflow
101
An API G/W is using caching - how do you ensure that certain requests are up to date?
Sending the HTTP header: Cache-Control: max-age=0
102
What are the AWS ECS placement strategies?
binpack - Tasks placed on instances so as to maximise used CPU/memory. Used to minimise number of instances used. random - tasks are placed randomly across instances spread - tasks are spread evenly across AZ or instances
103
How does ECS work with EC2?
Elastic Container Service - Run a batch of EC2 instances and deploy the container task to the instances with different placement strategies.
104
You have a bucket s3://mybucket with server logging & you have set the logs to be put into s3://mybucket/logs. What will happen?
When you write something to the bucket a log will be written to the bucket which will cause a log to be written to the bucket. This will be compounded by replication enabled.
105
How to deploy templatized serverless app via the cli?
1. aws s3 mb s3://bucketname # and move the code into that bucket 2. aws sam package 3. aws sam deploy To delete use aws cloudformation delete-stack
106
How do you deploy a templatized generic application?
aws cloudformation create-stack
107
What does an application do once it has successfully processed a message from the SQS queue
Uses the DeleteMessage API to delete the message.
108
Within a lambda there is the handler space & the global space - what can these be used for?
The handler space is the function called when the lambda is invoked (a handler). The global space is the code outside of the handler & can be reused between lambda calls (although one should not assume this to be the case). This can be useful for saving time with reusing DB connection objects.
109
What is the best solution for coordinating many Lambda functions?
AWS step functions
110
What are the benefits of using S3 cross-region replication?
Reduce latency if there are users across different regions
111
An application is designed to use Amazon SQS to manage messages from many independent senders. Each sender's messages must be processed in the order they are received. Which SQS feature should be implemented by the Developer?
Configure each sender with a unique MessageGroupId. Set the SQS queue type to be FIFO (messages guaranteed to be in order).
112
What is in the EC2 meta data and how can it be read?
http://169.254.169.254/latest/metadata/
113
Can AWS Cognito have a custom authorizer?
Yes
114
What S3 bucket operations are eventually consistent?
S3 overwrite DELETE or PUT operations
115
How is manual approval done in CodePipeline?
Use an approval action in a stage
116
What is AWS CodeStar?
Quickly develop, build & deploy on AWS
117
What is an ECS task?
The running container with the settings defined in the task definition. The IAM role assumed by the task is used by the container.
118
What is an ECS service?
The ECS Service is responsible for running the ECS tasks (containers), registering the tasks with the load balancer & spreading, scaling tasks & relaunching tasks in case of an error (self-healing).
119
What is another word for the caching strategy "lazy-loading"?
cache-aside caching strategy
120
Where can AWS Lambda store temporary files which only need to be used within the Lambda function?
/tmp directory it can store about 500 MB
121
How can a Lambda function be triggered periodically?
Event bridge or CloudWatch events
122
How can you deploy an AWS Lambda function using cloudformation?
Upload the code in .zip to S3 & reference it in the cloudformation template Include the Lambda function code in the cloudformation template For docker environments you can refer to the ECR repo
123
What are API g/w route selection expressions?
An expression that is evaluated when the service is selecting the route to follow for an incoming message. E.g. $request.body.action
124
What happens if the API g/w does not match a route selection expression?
Goes to the $default (if $default is defined) otherwise it returns an error.
125
How to debug AWS Lambda functions?
Using the AWS SAM to invoke a function locally in debug mode.
126
An AWS Lambda function fails after multiple attempts how to debug the problem?
Using AWS CloudTrail Logs.
127
What is API Gateway Mapping Templates?
Takes a payload and transforms it (reduces data or transforms the data into a different format).
128
What is AWS CloudFormation cross-stack references?
Output values from a cf stack that can be imported for use in other stacks via Fn::ImportValue
129
What is reserved concurrency on a Lambda function?
Guarantees that the given Lambda function has a certain amount of concurrency and also prevents that function from exceeding that limit.
130
How to quickly debug a build in AWS CodeBuild?
Run AWS CodeBuild locally using CodeBuild Agent
131
What is an example of AWS Mappings?
``` Mappings: RegionMap: us-east-1: hvm64: "ami-..." hvmg2: "ami-..." ........ ``` ImageId: !FindInMap - RegionMap # The map used - !Ref 'AWS:Region' # Refer to the region which we are in as the first key - HVM64 # Desired architecture that we want.
132
How to monitor Elastic Load Balancers?
Load Balancer Access logs
133
What is Cross-Zone Load Balancing?
The node of a load balancer will distribute requests from clients to all available targets in all availability zones. If it is disabled the node will only distribute traffic to the registered targets in it's AZ.
134
How to speed up codebuild?
Bundle the dependencies in the source code
135
What is the difference between a FilterExpression & ProjectionExpression?
ProjectionExpression identifies the attributes that you want and is done at the query level. FilterExpression - will filter out the items based on a given condition
136
Does AWS have a message limit for storing in SQS?
No - but it does have an in-flight limit of 120,000 messages
137
Performance of gp2 volumes are tied to volume size. At what volume does the volume max out?
5.3 TiB
138
What is Amazon RedShift?
Designed for large data set storage & analysis
139
What is Amazon Athena?
Interactive query service to analyse data on S3 using SQL
140
What are valid CloudFormation params?
String, Number, List, CommaDelimitedList, EC2 key pair, security group etc.
141
You want your Lambda function to have a low latency at a time of high traffic demand. How do you do this?
Configure Application Auto Scaling to manage provisioned concurrency on a schedule to ensure that requests are served with a low latency.
142
How many route tables can a subnet be associated with at a time?
One route table.
143
For io1 volumes what is the ratio of maximum provisioned iops to volume size (in GiB)
50:1 - 200 GiB can be provisioned up to 10000
144
What RDS DB types allow for IAM authentication?
MySQL & PostgreSQL
145
What type of reserved instance provides capacity reservation?
Zonal reserved instances
146
What is the secure way of sshing into ec2 instances?
Given a private key generate a public key from that private key. Import the public key into an AWS region
147
You have configured a developer profile and you would like to test the user cannot terminate instances,. How do you do this?
aws --dry-run | This checks whether you have the permissions for the action without actually making the request.
148
What is AWS Step functions state machines?
Coordinates applications & microservices using visual workflows
149
What is AWS Step functions activities?
Associates code running which a specific task in a state machine.
150
You enable S3 event notification on every event - how do you ensure you receive a notification for every object write?
Enable versioning on the bucket
151
What elastic beanstalk environment should you use to decouple long running tasks from tasks which need to respond quickly?
Dedicated worker environment
152
For application load balancers is cross-zone load balancing enabled?
Yes - always.
153
When should db caches be used?
For read-intensive operations - not so useful for write-intensive operations
154
What are the different monitoring levels?
Basic monitoring - 5mins Detailed monitoring 1 min interval High-resolution monitoring - up to 1 second interval
155
A Lambda function fails multiple times - how can you debug this?
Configure Lambda to send the request to a deadletter queue for later processing
156
How to speed up CodeBuild times?
Caching dependencies in an S3 cache.
157
What is the maximum number of SQS messages that can be retrieved at a time?
10
158
Does a Network Load Balancer modify the TCP socket?
No - so app s/w doesn't need X-Forwarded-For
159
If you lambda code + dependencies are larger than 50 MB how can you upload it?
Zip the code + dependencies into separate folders and upload it to S3
160
What does changing the AWS CLI --page-size option to be below 1000 do?
CLI still returns the full list but will perform a larger number of API calls with a smaller number of items returned on each call. It is good to avoid timeout errors.
161
What does changing the AWS CLI --max-items option do?
Sets a maximum number of items returned. If the items returned has been limited the output includes a NextToekn that you can pass to the next command to retrieve the next set of items.
162
What does --starting-token AWS CLI option do?
If the max-items has been limited then you can pass the NextToken of the previous call to get the next group of messages.