AWS 19 Flashcards
Docker can run on lambda, true or false?
False
When is Lambda synchronously invoked?
ELB; API Gateway; CloudFront; Amazon S3 Batch; Amazon Cognito; AWS Step Functions
How do we register Lambda with an ALB?
Make sure Lambda is registered in a target group
What are multi-value headers in an ALB and Lambda?
When you have HTTP headers or query string paramaters that are sent with multiple values, they are shown as arrays within the AWS Lambda event and response objects;
*It is a setting on the ALB
What allows the ALB to invoke the lambda?
A resource based policy. Remember, we set a resource based policy when other services want to communicate with lambda
What is Lambda@Edge?
We can deploy Lambda functions alongside your CloudFront CDN to build more responsive applications;
You can use Lambda to change CloudFront request and responses
What triggers Lambda asynchronously?
S3, SNS, CloudWatch Events/EventBridge
How does Asynchronous Lambda work? What is it good for?
The events are placed in an Event Queue;
It is good for speeding up processes you don’t need to wait for
How do we make sure an event is sent from S3 to Lambda for every successful write?
Make sure versioning is enabled. It is possible that two writes can be made to the same bucket and only one notification is sent if non-versioning is enabled.
What three services can Lambda event source map?
Kinesis streams, SQS & SQS FIFO queu, DynamoDB streams
When Lambda does event source mapping, is this a syncronous operation or async?
Synchronous because Lambda needs to poll from the source and then triggers a Lambda function
For Lambda and Streams, what happens if a function returns an error?
The entire batch is reprocessed until success or batch is expired
Lambda ESM will poll SQS using what method?
Long Polling
To set up a DLQ for Lambdas ESM with SQS, what do we do?
We must set it up on the SQS queue, not Lambda (DLQ for Lambda is only for async invocations)
For Lambda and FIFO queue, scaling lambdas up to number of active message groups is permitted, true or false?
True
How can we speed up processing with Lambda and Streams?
We can process multiple batches in parallel;
Up to 10 batches per shard;
For streams and parallelization, in-order processing is not guaranteed for each partition key, true or false?
False. It is guaranteed
For processing async invocations in Lambda, we should make sure the logic is?
Idempotent, in case of retries. The same invocation will produce the same result
Before an async invocation hits the lambda, where does it go?
It goes through an internal event queue in Lambda
What is the Event Source Mapping in Lambda used for?
Polling and receiving a batch from a stream source
When an error occurs with Lambdas and queues, what happens?
Remember that this would be for Event Source Mapping;
Batches are returned to the queue as individual items and might be processed in different grouping than the original batch
How can we handle errors in Lambda event source mapping with streams?
Restrict the number of retries;
Split the batch on error (to work around Lambda timeout issues);
Set a destination for failed events;
What is the idea of destinations in Lambda?
To send the result of an async invocation or an event mapper to a specified location