AWS Lambda Function - Q & A
bogotobogo.com site search:
What is Lambda?
AWS Lambda was introduced in 2014, and it is a compute service that runs code in response to events and automatically manages the compute resources required by that code.
The purpose of Lambda, as opposed to AWS EC2, is to simplify building smaller, on-demand applications that are responsive to events and new information. AWS targets starting a Lambda instance within milliseconds of an event.
AWS Lambda was designed for use cases such as image upload, responding to website clicks or reacting to output from a connected device. AWS Lambda can also be used to automatically provision back-end services triggered by custom requests.
Unlike Amazon EC2, which is priced by the hour, AWS Lambda is metered in increments of 100 milliseconds.
- wiki - Amazon Lambda
Q & A
- How can we increase the CPU resources for our Lambda?
Ans: Increase the configured memory value
(Note) To increase the memory and CPU power allocated to our function, we need to use the Memory setting. Lambda allocates CPU power linearly in proportion to the amount of memory configured. - How are computing resources allocated to Lambdas?
1. proportionally
2. equally
3. periodically
4. daily
Ans: #1
- How can additional code or content can be provided for Lambda?
Ans: layers
(Note) We can configure our Lambda function to use additional code and content in the form of layers.
A layer is a ZIP archive that contains libraries, a custom runtime, or other dependencies.
With layers, we can use libraries in our function without needing to include them in our deployment package.
To include libraries in a layer, place them in the directory structure that corresponds to our programming language. - How do you author a Lambda in a programming language that AWS does not support?
1. Create a Lambda function with a custom runtime and reference the function in your Lambda
2. Create a Lambda layer with a custom runtime and reference the layer in your lambda
3. You cannot use Lambda in this situation
4. Create a Lambda function with a custom runtime
Ans: #2
- How can Step Functions call Lambdas?
Ans: in sequence or in parallel
- How can Step Functions call Lambdas?
Ans: in sequence or in parallel
- Which AWS CLI command invokes a function?
1. aws lambda invoke --function ReturnBucketName outputfile.txt
2. aws lambda execute --function-name ReturnBucketName outputfile.txt
3. aws lambda invoke --function-name ReturnBucketName outputfile.txt
4. aws lambda execute --function ReturnBucketName outputfile.txt
Ans: #3
- What adds tracing capabilities to a Lambda?
1. AWS Trace
2. CloudStack
3. CloudTrail
4. AWS X-Ray
Ans: #4
- You need to build a continuous integration/deployment pipeline for a set of Lambdas. What should you do?
Ans: Create CloudFormation templates and deploy them using AWS CodePipeline
- What can you use to monitor function invocations?
1. API Gateway
2. S3
3. SAS
4. CLoudTrail
Ans: #4
- It is AWS best practice to enable Lambda logging by which of these methods.
1. Use S3 metrics and CloudWatch alarms
2. Create custom metrics within your Lambda code
3. Create custom metrics within your CloudWatch code
4. Use Lambda metrics and CloudWatch alarms
Ans: #4
- Lambda allows for running of what other things?
1. binaries
2. all of these answer
3. executables
4. shell scripts
Ans: #2
- In what style must you write Lambda code?
1. MVC
2. virtual
3. stateless
4. protocol
Ans: #3
- What does Lambda logging include?
1. logging streams
2. rotating streams
3. logging events
4. advancing log groups
Ans: #1
- What can AWS Amplify NOT do for a Lambda?
1. create a Lambda
2. assign an IAM role
3. delete a Lambda
4. be an event source
Ans: #4
- What are listed downstream resources based on?
1. the execution policy
2. the Lambda configuration
3. the Lambda nodes
4. the IAM user
Ans: #2
- How do you stop a running Lambda that is stuck in a recursive loop?
1. delete the function
2. set the function concurrent execution limit to 0 while you update the code
3. reset the function
4. set the function concurrent execution limit to 100 while you update the code
Ans: #2
- What is AWS best practice for Lambda configuration?
Ans: Overprovision memory to run your functions faster and reduce your costs. Do not overprovision your function timeout settings
- Basic Lambda permissions include permissions for what?
1. removing log groups
2. creating log groups
3. updating log groups
4. none of the above
Ans: #3
(Note) The default execution role that the Lambda console creates only has permission to store logs in Amazon CloudWatch Logs.
Refs
AWS (Amazon Web Services)
- AWS : EKS (Elastic Container Service for Kubernetes)
- AWS : Creating a snapshot (cloning an image)
- AWS : Attaching Amazon EBS volume to an instance
- AWS : Adding swap space to an attached volume via mkswap and swapon
- AWS : Creating an EC2 instance and attaching Amazon EBS volume to the instance using Python boto module with User data
- AWS : Creating an instance to a new region by copying an AMI
- AWS : S3 (Simple Storage Service) 1
- AWS : S3 (Simple Storage Service) 2 - Creating and Deleting a Bucket
- AWS : S3 (Simple Storage Service) 3 - Bucket Versioning
- AWS : S3 (Simple Storage Service) 4 - Uploading a large file
- AWS : S3 (Simple Storage Service) 5 - Uploading folders/files recursively
- AWS : S3 (Simple Storage Service) 6 - Bucket Policy for File/Folder View/Download
- AWS : S3 (Simple Storage Service) 7 - How to Copy or Move Objects from one region to another
- AWS : S3 (Simple Storage Service) 8 - Archiving S3 Data to Glacier
- AWS : Creating a CloudFront distribution with an Amazon S3 origin
- AWS : Creating VPC with CloudFormation
- AWS : WAF (Web Application Firewall) with preconfigured CloudFormation template and Web ACL for CloudFront distribution
- AWS : CloudWatch & Logs with Lambda Function / S3
- AWS : Lambda Serverless Computing with EC2, CloudWatch Alarm, SNS
- AWS : Lambda and SNS - cross account
- AWS : CLI (Command Line Interface)
- AWS : CLI (ECS with ALB & autoscaling)
- AWS : ECS with cloudformation and json task definition
- AWS Application Load Balancer (ALB) and ECS with Flask app
- AWS : Load Balancing with HAProxy (High Availability Proxy)
- AWS : VirtualBox on EC2
- AWS : NTP setup on EC2
- AWS: jq with AWS
- AWS & OpenSSL : Creating / Installing a Server SSL Certificate
- AWS : OpenVPN Access Server 2 Install
- AWS : VPC (Virtual Private Cloud) 1 - netmask, subnets, default gateway, and CIDR
- AWS : VPC (Virtual Private Cloud) 2 - VPC Wizard
- AWS : VPC (Virtual Private Cloud) 3 - VPC Wizard with NAT
- DevOps / Sys Admin Q & A (VI) - AWS VPC setup (public/private subnets with NAT)
- AWS - OpenVPN Protocols : PPTP, L2TP/IPsec, and OpenVPN
- AWS : Autoscaling group (ASG)
- AWS : Setting up Autoscaling Alarms and Notifications via CLI and Cloudformation
- AWS : Adding a SSH User Account on Linux Instance
- AWS : Windows Servers - Remote Desktop Connections using RDP
- AWS : Scheduled stopping and starting an instance - python & cron
- AWS : Detecting stopped instance and sending an alert email using Mandrill smtp
- AWS : Elastic Beanstalk with NodeJS
- AWS : Elastic Beanstalk Inplace/Rolling Blue/Green Deploy
- AWS : Identity and Access Management (IAM) Roles for Amazon EC2
- AWS : Identity and Access Management (IAM) Policies, sts AssumeRole, and delegate access across AWS accounts
- AWS : Identity and Access Management (IAM) sts assume role via aws cli2
- AWS : Creating IAM Roles and associating them with EC2 Instances in CloudFormation
- AWS Identity and Access Management (IAM) Roles, SSO(Single Sign On), SAML(Security Assertion Markup Language), IdP(identity provider), STS(Security Token Service), and ADFS(Active Directory Federation Services)
- AWS : Amazon Route 53
- AWS : Amazon Route 53 - DNS (Domain Name Server) setup
- AWS : Amazon Route 53 - subdomain setup and virtual host on Nginx
- AWS Amazon Route 53 : Private Hosted Zone
- AWS : SNS (Simple Notification Service) example with ELB and CloudWatch
- AWS : Lambda with AWS CloudTrail
- AWS : SQS (Simple Queue Service) with NodeJS and AWS SDK
- AWS : Redshift data warehouse
- AWS : CloudFormation
- AWS : CloudFormation Bootstrap UserData/Metadata
- AWS : CloudFormation - Creating an ASG with rolling update
- AWS : Cloudformation Cross-stack reference
- AWS : OpsWorks
- AWS : Network Load Balancer (NLB) with Autoscaling group (ASG)
- AWS CodeDeploy : Deploy an Application from GitHub
- AWS EC2 Container Service (ECS)
- AWS EC2 Container Service (ECS) II
- AWS Hello World Lambda Function
- AWS Lambda Function Q & A
- AWS Node.js Lambda Function & API Gateway
- AWS API Gateway endpoint invoking Lambda function
- AWS API Gateway invoking Lambda function with Terraform
- AWS API Gateway invoking Lambda function with Terraform - Lambda Container
- Amazon Kinesis Streams
- AWS: Kinesis Data Firehose with Lambda and ElasticSearch
- Amazon DynamoDB
- Amazon DynamoDB with Lambda and CloudWatch
- Loading DynamoDB stream to AWS Elasticsearch service with Lambda
- Amazon ML (Machine Learning)
- Simple Systems Manager (SSM)
- AWS : RDS Connecting to a DB Instance Running the SQL Server Database Engine
- AWS : RDS Importing and Exporting SQL Server Data
- AWS : RDS PostgreSQL & pgAdmin III
- AWS : RDS PostgreSQL 2 - Creating/Deleting a Table
- AWS : MySQL Replication : Master-slave
- AWS : MySQL backup & restore
- AWS RDS : Cross-Region Read Replicas for MySQL and Snapshots for PostgreSQL
- AWS : Restoring Postgres on EC2 instance from S3 backup
- AWS : Q & A
- AWS : Security
- AWS : Security groups vs. network ACLs
- AWS : Scaling-Up
- AWS : Networking
- AWS : Single Sign-on (SSO) with Okta
- AWS : JIT (Just-in-Time) with Okta
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization