AWS Lambda
Q1. How can you increase the CPU resources for your Lambda?
Q2. How can additional code or content be provided for your Lambda?
Q3. How can Step Functions call Lambdas?
Q4. Which AWS CLI command invokes a function?
Q5. What adds tracing capabilities to a Lambda?
Q6. You need to build a continuous integration/deployment pipeline for a set of Lambdas. What should you do?
Q7. What can you use to monitor function invocations?
Q8. It is AWS best practice to enable Lambda logging by which of these methods.
Q9. What may be provided for environment variables?
Q10. Lambdas allow for running of what other things?
Q11. In what style must you write Lambda code?
Q12. How can a developer provide Lambda code?
Q14. What facilitates continuous delivery of Lambdas?
Q15. How are computing resources allocated to Lambdas?
Q16. You can restrict the scope of a user’s permissions by specifying which two items in an IAM policy?
Q17. What does Lambda logging include?
Q18. What can AWS Amplify NOT do for a Lambda?
Q19. How do you author a Lambda in a programming language that AWS does not support?
Q20. What are listed downstream resources based on?
Q21. Which is an equivalent and valid tag for a pair of Lambdas?
Q22. Outbound connections from Lambdas must be _
.
Q24. You are testing your stream-based application and the associated Lambda. AWS best practice advises you to test by varying what?
Q25. You need to make your Lambda available to services in multiple VPCs. What do you do?
Q26. How is the cost associated with Lambda function calculated?
Q27. What is the fastest way to get started with Lambda?
Q28. Where is the disk space allocated for Lambda functions?
Q29. How do you stop a running Lambda that is stuck in a recursive loop?
Q30. What is AWS best practice for Lambda configuration?
Q31. Basic Lambda permissions include permissions for what?
Q32. How are environment variables stored?
Q33. You need to use a Lambda to provide backend logic to your website. Which service do you use to make your Lambda available to your website?
Q34. You are creating a Lambda to trigger on change to files in an S3 bucket. Where should you put the bucket name?
Q35. What action is needed before you can test a Lambda?
Q36. What kind of packages can you use with Node.js for Lambdas?
Q37. Lambdas are monitored by default using which service?
Q38. What can trigger a Lambda function execution?
Q40. To make Lambdas more testable, it is AWS best practice to separate which of these?
Q41. What is included in an exported Lambda deployment package?
Q42. When can you change the execution role of a Lambda?
Q44. What service deploys Lambdas regionally?
Q45. What programming language does AWS Lambda support?
Q46. You need to setup a mechanism to put controls in place to notify you when you have a spike in Lambda concurrency. What should you do?
Q47. You want to minimize cold start time for your Lambda. What do you do?
[Reference](https://aws.amazon.com/blogs/compute/new-for-aws-lambda-predictable-start-up-times-with-provisioned-concurrency/
Q48. When is Lambda code stored encrypted?
Reference
Q49. When you use a resource-based policy to give a service, resource, or account access to your function, how can you apply the scope of that permission??
Reference
Q50. Lambda can read events from which other AWS services? (ref-https://docs.aws.amazon.com/lambda/latest/dg/lambda-services.html)
Explanation
Lambda can used for all services mentioned on the question: Kinesis, S3, SNS, SQS, DynamoDB. But as you can see in the reference, Lambda's responsibility and method invocation can be categorized by Lambda polling and Event Driven (synchronous invocation). When you implement an event-driven architecture, you grant the event-generating service permission to invoke your function in the function's resource-based policy. Then you configure that service to generate events that invoke your function. When you implement a Lambda polling architecture, you grant Lambda permission to access the other service in the function's execution role. Lambda reads data from the other service, creates an event, and invokes your function. According to this analytics, Kinesis-DynamoDB-SQS use same method invocation, Lambda polling.
Q51. Via what can a Lambda be called?
Explanation (source google)
With DynamoDB Streams, you can trigger a Lambda function to perform additional work each time a DynamoDB table is updated. Lambda reads records from the stream and invokes your function synchronously with an event that contains stream records.
These events are considered synchronous events. Simply put, it means that when somebody is calling an API Gateway, it will trigger your Lambda function. It's a synchronous event because your Lambda function has to respond to the client directly at the end of its invocation.
You can use Lambda to process event notifications from Amazon Simple Storage Service. Amazon S3 can send an event to a Lambda function when an object is created or deleted.
52. which is use case of lambda ?
Q53. Events are AWS resources that trigger the Lambda function. What data type is the SAM file Events property?
Q54. A company is using an API built using Amazon Lambda, Amazon API Gateway, and Amazon DynamoDB in production. The developer has observed high latency during peak periods. Which approach would best resolve the issue?
Q55. The AWS Serverless Application Model (AWS SAM) is a model that ____ .
Q56. The code that you want AWS Lambda to invoke as per some defined triggers is known as _.
Q58. Lambdas can be created _.
Q59. You need to quickly understand execution times for two different Lambda functions with different invocation types: asynchronous and synchronous. What do you do?
Q61. Your function failed to execute due to a timeout. What type of error is this?
Q62. A company will be modernizing their application which is currently running on Amazon Elastic Cloud Compute (EC2) instances. They have experience with scaling this infrastructure using Amazon EC2 Autoscaling. They want to move to serverless infrastructure consisting of an Amazon API Gateway that triggers Lambda functions. They are consulting you about scaling this new infrastructure. What should the company consider in order to make sure the serverless infrastructure scales to their needs?
Explanation
In serverless it is important to understand the service limits of all the services used end to end to understand the level of requests that can be handled.
Q63. Can we use pakages with AWS Lambda?
Q64. Are AWS Lambda functions available and to what extent?
Q65. Is there any default limit to be applied at a functional level?
Q66. How long can an AWS Lambda function execute?
Q67. How does AWS Lambda secure my code?
Q68. Which languages are supported by AWS Lambda?
Q63. What does AWS Lambda mean?
Q64. What restrictions apply to AWS Lambda function code?
Q65. How long can an AWS Lambda function execute?
Q66. How does AWS Lambda secure my code?
Q67. Which languages are supported by AWS Lambda?
Q68. What is the definition of Auto-Scaling?
Q69. Is the infrastructure accessible on which the AWS Lambda runs?
Q70. Can I use packages with AWS Lambda?
Q71. Are AWS Lambda functions available and to what extent?
Q72. Is there any default limit to be applied at a functional level?
Q74. What is an AWS service or application that triggers a Lambda to run?
Explanation
An event source is an AWS service or developer-created application that produces events that trigger an AWS Lambda function to run. Some services publish these events to Lambda by invoking the cloud function directly (for example, Amazon S3).
https://aws.amazon.com/lambda/faqs/#:~:text=An%20event%20source%20is%20an,for%20example%2C%20Amazon%20S3
Q75. What does a Lambda need to access DynamoDB tables?
Q76. Which of the following is true about AWS Lambda pricing?
Explanation
- AWS Lambda charges are based on the number of requests (invocations) and the duration of time the code runs. Lambda pricing is based on the total number of requests and the time your code runs (in increments of 1 millisecond) from the start of the function until it returns or otherwise terminates. The duration is rounded up to the nearest 1ms.
Q77. What is the maximum execution timeout for an AWS Lambda function?
Explanation
- AWS Lambda allows a maximum execution timeout of 15 minutes for a single invocation. After 15 minutes, the function will be automatically terminated, even if the function’s process is still running. This is useful for long-running tasks but imposes a limit to ensure scalability and efficiency.
Q78. Which of the following triggers can NOT directly invoke a Lambda function?
Explanation
- Amazon RDS (Relational Database Service) cannot directly trigger a Lambda function. RDS is a managed database service and does not have built-in functionality to trigger Lambda directly. However, other services like S3, DynamoDB Streams, and API Gateway can trigger Lambda functions when specific events occur (e.g., file uploads, data changes, API calls).
Explanation
You would use CloudWatch to monitor memory-bound functions and create an alarm when memory consumption nears a preset limit. This will help you find out when memory consumption reaches close to the preset maximum value so that you can avoid processing bottlenecks by increasing the configured memory for the functions. AWS CloudWatch allows you to monitor the AWS system in real time by monitoring and tracking resource metrics.
Explanation
You would use a resource-based policy to grant the needed permissions. A resource-based policy is attached to an AWS resource such as an Amazon Simple Storage Service (S3) bucket, a virtual private cloud (VPC) endpoint, AWS Key Management Service (KMS) encryption keys, and Amazon Simple Queueing Service (SQS) queues. Using a resource-based policy, you specify the principal who can access the resource and their permissible actions on the resource. A principal can be an account, user, role, or session principal. Session principals can be IAM federated users or role sessions. Policies are AWS objects that specify the permissions of an identity or a resource. You can choose an identity-based or resource-based policy when you create a permissions policy for restricted access to resources.