Lambda Flashcards
(33 cards)
Lambda lets you run code without having to provision or manage servers. And this is called _____
Serverless
You’re only charged for requests and the compute time requests consume. There is no charge when your app is not used.
True or False
True
AWS Lambda stores code in _____ and encrypts it at rest.
Amazon S3
What are the benefits of Lambda ?
- No servers to manage ( zero administration)
- Continuous scaling
- Cost optimized
- Consistent performance at any scale
You are charged for every millisecond your code executes and the number of times your code is triggered. You won’t pay if it is not used.
True or False
True
With AWS Lambda, you can optimize your code execution time by choosing the right _____ size for your function.
memory
In Lambda, you can also keep your functions initialized and hyper-ready to respond within double digit milliseconds by enabling ____
Provisioned Concurrency
Serverless functions ?
- Event driven (file uploads, scheduled times, API requests)
- Code focused
- Managed machines
- Cost effective
- Service integration
- Scaling
A Lambda function’s _____ is an IAM role that grants the function permission to access AWS services and resources. You provide this role when you create a function, and Lambda assumes the role when your function is invoked. For example, Amazon CloudWatch for logs, and DynamoDB for storing data.
execution role
A ____ permission policy to allow an AWS service to invoke your function on your behalf.
resource-based
When AWS Lambda integrates with other AWS services to invoke functions, you can configure ___
- triggers to invoke a function for other resources’ lifecycle events
- respond to incoming HTTP requests
- consume events from other resources such a queue
- run on a schedule.
Each service that integrates with Lambda sends data to your function in _____ as an event.
JSON
When other services invoke your function directly
• You grant the other service permission in the function’s _____ policy
• Configure the other service to generate events and ___ your function.
resource-based,
invoke
Depending on the service, the Lambda invocation can be _____ or ______.
synchronous,
asynchronous
Services that do synchronous invocation on lambda are:
- Elastic Load Balancing (Application Load Balancer)
- Amazon Cognito
- Amazon API Gateway
- Amazon CloudFront (Lambda@Edge)
And more…
For asynchronous invocation, Lambda queues the event before passing it to your function.
The other service gets a success response as soon as the event is queued and isn’t aware of what happens afterwards.
True or False
True
Services that do asynchronous invocation on lambda are:
- S3
- SNS (Simple Notification Service)
- SQS
You can use _____ to adjust your function’s behavior without updating code.
environment variables
What is an environment variable ?
It is a pair of strings that are stored in a function’s version specific configuration.
You don’t need to release the app again for changing a value if there is a change. Instead, just change to environment variable at run time. The Lambda runtime makes environment variables available to your code.
True or False
True
______ is the number of requests that your function is serving at any given time. When the function code finishes running, it can handle another request.
Concurrency
If the function is invoked again while a request is still being processed, another instance is allocated, which increases the function’s _____
concurrency
Concurrency is subject to a ____ quota that is shared by all functions in a Region. Default quota for concurrent executions is ____.
Can be increased up to hundreds of thousands.
Regional,
1000
What are the two types of concurrency controls ?
- Reserved concurrency
2. Provisioned concurrency