Lambda Flashcards

1
Q

What is AWS Lambda?

A

A service for runing code without provisioning a server

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

Services that invoke Lambda Functions Synchronously

A
"ELB
Cognito
Lex
Alexa
API Gateway
CloudFront
Kinesis Data Firehose
Step Functions
S3 Batch"
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Services that invoke Lambda Functions Asynchronously

A
"S3
SNS
SES
CloudFormation
CloudWatch Logs
CloudWatch Events
CodeCommit
Config
IoT
IoT Events
CodePipeline"
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What may cause a Lambda to return an error message?

A

Max Memory Used

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

What may cause a Lambda to time out?

A

If a connection is unavailable due to access restrictions

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

What is the Dead-letter Queue feature?

A

“After a specified number of execution attempts have failed Lambda can forward the unprocessed payload to a DLQ such as an SQS or SNS for logging purposes
DLQs can trigger additonal Lambda functions”

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

What are the customers responsibilities when using Lambdas?

A

“Lambda function code
Providing access to AWS resources that trigger the Lambda function
Providing access to AWS resource destinations “

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

What is the Lambda memory limits per invocation?

A

memory allocation range min 128 MB/max 3008 MB (64 MB increments)

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

What is the Lambda timeout limits per invocation?

A

900 seconds (15 minutes)

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

What is the Lambda /tmp directory storage limit?

A

Ephemeral disk capacity (“/tmp” space) 512 MB

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

What are the Lambda incovation payload limits?

A
"invocation payloads include request and response
6 MB (synchronous)
256 KB (asynchronous)"
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What triggers and destinations are available by default?

A

“None are available by default

The AWSLambdaBasicExecutionRole grants permission to write to CloudWatch Logs”

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

Max batch size Lambdas can recieve from resources?

A

“Streams and DynamoDB 10_000

SQS 10 “

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

How do you send a constant event from a CloudWatch trigger?

A

In the CloudWatch event rules configure the input using the option “constant (JSON text)”

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

What is Lambda Invoke API?

A

An API used to invoke lambda functions from custom applications

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

What CloudFront events can be used to trigger Lambda functions?

A

“CloudFront uses a CloudFront cache at edge locations to improve accessibility to other regions
Viewer request - from end user to cache
Origin request - from cache to server
Origin response - from server to cache
Viewer response - from cache to end user”

17
Q

Do Lambda functions stay available while code is being configured?

A

Yes Lambdas remain in a consistant state from one version to another and function remains even while the code it being updated

18
Q

What are the poll-based services that Lambda supports?

A

“*Poll-based services wait for an external device to check for rediness or state
Kinesis
DynamoDB
SQS”

19
Q

What is the alias feature?

A

“It allows lambdas to have different reference names
alias’s allow functions to call lambdas without having to know the specific version the alias is pointing to
Use case creating a PROD and DEV alias”

20
Q

In what case would a versioning number be reused?

A

“Never

even if a version is deleted new versions will have completely unique version numbers”

21
Q

Valid syntax for ARNs representing Lambda functions

A

“Qualified ARN: the function ARN with the version suffix

arn: aws:lambda:aws-region:acct-id:function:helloworld:$LATEST
arn: aws:lambda:aws-region:acct-id:function:helloworld:ALIAS

Unqualified ARN: the function ARN without the version suffix
arn:aws:lambda:aws-region:acct-id:function:helloworld”

22
Q

How can you grant cross-account permissions to use Lambda functions?

A

“If an application and the lambda are in the same AWS account no explicit permission is needed
Otherwise the AWS account that owns the Lambda function must add permission on their lambda in its policy
IAM- Cross account role
““Statement””: { ““Effect””: ““Allow””, ““Action””: ““sts:AssumeRole””, ““Resource””: ““arn:aws:iam:ROLE_NAME:role/UpdateApp””
Lambda function policy cannot be edited from the AWS console only the AWS CLI or AWS SDK”

23
Q

What is the maximum asynchronous invokation retries?

A

2

24
Q

How do you pass encrypted environment variables to a Lambda function?

A

“Encrypt data in tansit to the lambda via KMS key

decrypt the data via the decryption helper in the console”

25
Q

What actions are required by a Lambda execution role to write to logs?

A

“logs:CreateLogGroup

logs: CreateLogStream
logs: PutLogEvents”

26
Q

What are the CloudWatch metrics able to trigger Lambda functions?

A
"Invocations
Errors
Dead letter error
Duration
Throttles
IteratorAge
ConcurrentExecutions
UnreservedConcurrentExecutions"
27
Q

What factors must be concidered when estimating cost?

A

“memory allocated to the Lambda function

total number of requests for the Lambda function”