AWS Lambda Flashcards

1
Q

Lambda overview

A

Event driven, servless computing platform.
Lambda function - code run on AWS lambda ( in isolated containers).
We can run on the lambda console or locally and upload it.
To speed up use sam or servless framework.
Once thencode is deployed to lambda it runs whenever is triggered by preconfigured event source ( API gateway calls, changes to db data, sms, 3rd parttxapi etc.)

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

Lambda Console

A

Function name, trigfees ( in/out)
CodeEbtryType, runtime (e.g. java), handler ( function inside the file)
Environment variables- can be accessed in code, encrypted.
Tags - to e.g. group, filter functions, kv pairs
Roles
Basic settings ( e.g. memory, timeout).
Network - function will run in the vpc is attached to and has access only to the particular resources)
Debugging - define dlq in case of some problems.
Concurrency - linlmit of 1000, if you set 100, 900 will be availabele to remaining lambda functions.
Auditing and compliance ?
in the ur : test options, actions, qualifiers, throttle, ul: monitoring

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

Lambda Permissions Model

A

Different trigger events to the left ( in console).
Servixes a lambda has access to to the right.

Key icon will show the invocation / function policy (trigger) and execution role /polocy assigned to this function.
Trigger / execution is decpupled.

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

Lambda handler function (node.js 6 vs 8)

A

6 callback, 8 async

export.handler = #^#^ => {

callback(null, result); // 6
return result; // 8
}

8 : async, Promise, await

event - source of input data, depends on event

context - function name, memory etc.

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

EventObject, invocationTypes, EventSource

A

EO - input data we wont the lambda to act on. The structure depends on the type of event

IT sync and async, depends on event spurxe e.g. s3 is always async, API hateway, cognito - sync. This we dont have control of. But with ournown lambdas we can choose.
ES
push
Push event to lambda /s3 api gateway/
pull/poll
lambda pulls /dynamoDb, kinesis, sqs/

DynamoDB pushbtondynamoDb streams from which lambda pulls

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

ContextObject

A

Runtime info, e.g. how mich timenuntil timeout, request id. Kognito identity, clientContext (mobile info)

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

Error Handling

A

callback(error);

throw error;

console.log - in the lambda console as well as cloud watch(it takes a few sec to show up, cLogs in thenlambda console)

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

AWS Lambda Limits 2018

A

Memory size 128 MB to 3008 MB, 64 increment
Ephemeral Disk Capacity 512
Timeout 15 minutes to run
Body Payload 6 MB sync, 128KB async
Deploy package 50MB compressed, 250 MB uncompressed
Total.package size within a region 75GB
Concurency 1000 executions

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