{"id":20271761,"url":"https://github.com/rodneyshag/aws_lambda","last_synced_at":"2026-02-03T10:01:37.350Z","repository":{"id":123421481,"uuid":"215112472","full_name":"RodneyShag/AWS_Lambda","owner":"RodneyShag","description":"AWS Lambda tutorial","archived":false,"fork":false,"pushed_at":"2020-05-11T17:55:23.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-19T09:50:23.028Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RodneyShag.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-14T18:05:10.000Z","updated_at":"2020-05-11T17:55:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"37d168d5-3d45-4990-bfcb-8817f2bcf6af","html_url":"https://github.com/RodneyShag/AWS_Lambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RodneyShag/AWS_Lambda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RodneyShag%2FAWS_Lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RodneyShag%2FAWS_Lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RodneyShag%2FAWS_Lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RodneyShag%2FAWS_Lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RodneyShag","download_url":"https://codeload.github.com/RodneyShag/AWS_Lambda/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RodneyShag%2FAWS_Lambda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29040727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T09:57:37.951Z","status":"ssl_error","status_checked_at":"2026-02-03T09:55:14.920Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T12:39:18.486Z","updated_at":"2026-02-03T10:01:37.328Z","avatar_url":"https://github.com/RodneyShag.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/lambda_logo.png\"\u003e\n\u003c/p\u003e\n\n\n# AWS Lambda - Learning Strategy\n\n1. Spend 10 minutes on the [Serverless Hello World](https://aws.amazon.com/getting-started/tutorials/run-serverless-code) tutorial. You will:\n    1. Create a Lambda with code populated for you\n    1. Test the Lambda with simple sample data\n    1. View the logs CloudWatch created for you in Lambda's \"Monitoring\" tab\n1. This repo is a concise summary and _replacement_ of the [AWS Lambda](https://acloud.guru/learn/aws-lambda) tutorial by \"A Cloud Guru\". The course link is provided in case you need video examples (such as how to hook up AWS Kinesis to Lambda).\n1. (Optional) [Serverless Architectures with AWS Lambda](https://d1.awsstatic.com/whitepapers/serverless-architectures-with-aws-lambda.pdf?did=wp_card\u0026trk=wp_card)\n\n# Section 1\n\n### What is Serverless?\n\n- __What does \"serverless\" mean?__ - (0:48) serverless means you're not in charge of the servers, it doesn't mean that there are no servers.\n- __What are the tenets of serverless?__ - (1:32)\n  - You bring the code, provider brings the infrastructure\n  - Scale seamlessly with demand\n  - Pay as you go, but never pay for idle time\n- __What components will be needed for a full web app? (according to this video)__ - (3:12)\n  - Lambda - Functions as a Service (compute)\n  - API Gateway - HTTP endpoints (for your lambda functions) as a Service (connectivity)\n  - DynamoDB - NoSQL (storage)\n  - S3 - object store (storage)\n  - Cognito - User management \u0026 authentication (security)\n  - Certificate Manager - free. Automatically updates SSL certificates for API gateway (security)\n\n### Why Lambda\n\n- __What are some use cases?__ (1:00)\n  - [ETL](https://www.webopedia.com/TERM/E/ETL.html) jobs - when you extract data, transform it, and load it into another data source. You can:\n    - take data that's being put into S3 and load it into a Redshift database.\n    - take data that's coming in via HTTP calls and put it into a SQL database.\n  - APIs - Creating Rest APIs with API gateway.\n  - Mobile backends - Lambda will do the \"compute\" part (either through AWS mobile services, or API Gateway, or directly invoking from the SDK)\n  - Infrastructure automation - Reacting to events. If an instance is going to be retired, your Lambda can react and remediate that automatically\n  - Data validation - Since Lambda can listen to events from DynamoDB and Aurora, Lambda can do data validation. You can let data be written to a database, and Lambda can pick that up (via a trigger) and can validate an address is correctly formatted.\n  - Security remediation - Some AWS Services are built around Lambda functions. AWS Config lets you supply custom Lambda functions to remediate security and configuration issues that AWS Config finds.\n\n\n# Section 2\n\n### About Blueprints and Handlers?\n\n- __What is AWS Lambda's \"Serverless Application Repository\"__ - (1:20) lets you find deploy serverless apps published by developers, companies, and partners on AWS\n\n### Create the Function\n\n- __What happens when you increase Lambda memory?__ - (2:14) Increasing memory also increases CPU and network bandwidth (along width cost). If you need more memory to finish something, increasing memory can actually save you money if Lambda finishes faster.\n- __How get more cores for your Lambda?__ - (3:12) if you go above 1500MB of memory you automatically get 2 cores. This helps in parallel processing.\n\n### Testing and Logging\n\n- __Where are Lambda logs saved?__ - (1:57) Cloudwatch.\n- __Are logs saved automatically?__ - (2:15) Yes.\n- __How can you get \"warn\", \"info\", and \"debug\" level logging?__ - (2:04) `console.log` is just standard logging. To get \"warn\", \"info\" and \"debug\" level logging you need to find a logging library.\n\n\n# Section 3\n\n### Updating Lambda Functions with the AWS CLI\n\n- __What is `context` variable in Javascript's `exports.handler = async (event, context) =\u003e ...`?__ - (2:20) lets us communicate with the Lambda runtime. One example is `context.getRemainingTimeInMillis()`\n\n### Function Versions and Qualifiers\n\n- __What's a qualifier/version?__ - (0:30) a named pointer to Lambda code along with its configuration\n- __What is `$LATEST` qualifier?__ - the default qualifier. Points to your most recent version of your Lambda function.\n- __What is a Lambda alias?__ - (2:10) a pointer to a specific version of a Lambda function.\n- __How can you do A/B testing with Lambda?__ - (2:35) when creating an alias, you can choose 2 different versions of your Lambda to invoke.\n\n### Function Outputs and Timeouts\n\n- __Where do your Lambda function's return value(s) get stored?__ - (0:10) they're not stored anywhere by default. If Lambda was reached through API gateway, the return value would be sent back to the user.\n- __What are 2 things that can cause your Lambda to be killed?__ - Run out of memory, or run out of time.\n- __What is API Gateway's hard time limit for Lambdas?__ - (2:05) 29 seconds\n- __What can you do if your job (in Lambda) is too big?__\n  - Break your job into smaller bits, spinning off multiple jobs from 1 job.\n  - Use another service\n    - Fargate - a container runtime that's easier to run than classic ECS since you're not running the container instances yourself.\n    - AWS Batch - aimed at data processing workloads and big data.\n    - S3 Select - pulling values out of structured s3 objects.\n\n\n# Section 4 - Kinesis\n\n### Introduction to Kinesis\n\n- __What is Kinesis?__ - (0:25) an event streaming service. A gigantic log where all events come in as ordered streams by time.\n- __What's a Kinesis stream?__ - (1:00) a group of shards that's configurable. You can add/remove shards as needs change.\n- __Do shards maintain old events?__ - (1:10) every shard maintains last 24 hours of events, so if a new client comes online, it can process the last 24 hours of data. Or, if your real-time processing system goes offline, once it comes back online it can access the data it missed.\n- __In Kinesis, what's the releationship between events and shards?__ (1:35) Shards don't have the same events. Events are put in a kinesis stream and assigned a shard (such as events 1-8 below). Different events go on different shards.\n\n![Shards](images/shards.png)\n\n- __How does Lambda receive a group of events?__ - (1:45) Lambda can receive up to 100 events, but they will all be from the same shard.\n\n### Create a Stream and Function Trigger\n\n- __What do shards do?__ - (0:40) They determine stream capacity. Each shard gives you approximately 1 MB/s throughput\n- __How are Kinesis payloads encoded?__ (0:50) base-64. You must decode it in your Lambda function.\n- __What permissions do we need for Lambda/Kinesis connection?__ - (1:06) create an IAM role in IAM console to access our stream. Attach the `AWSLambdaKinesisExecutionRole` policy to the role, which allows AWS to let Kinesis invoke your lambda function, and pass it records from the Kinesis stream.\n- __How handle \"streaming\" data?__ - (2:10) '\"Batch size\" is how many records we receive at a time, like 100. In the Lambda, we can loop through these records\n\n### End-to-End Testing with Kinesis Events\n\n- __What is 1 way to put records into a Kinesis stream?__ - (0:05) Can use AWS CLI to put JSON records into a Kinesis stream. The CLI will base-64 encode the records for you.\n\n\n# Section 5 - DynamoDB\n\n### Create and Test the Function\n\n- __What is 1 use case for DynamoDB with Lambda?__ - (Entire section) Can have DynamoDB be a trigger for Lambda. When an item is written to DynamoDB, a Lambda can be triggered, which can add additional key/values to that item. For example, Lambda can take DynamoDB item with `gross` and `cost`, calculate `profit = gross - cost`, and write that item back to DynamoDB with the additional key/value pair for `profit`.\n\n\n# [Serverless Architectures with AWS Lambda](https://d1.awsstatic.com/whitepapers/serverless-architectures-with-aws-lambda.pdf?did=wp_card\u0026trk=wp_card)\n\nThese notes are not from the course.\n\n- __What is a \"warm container\"?__ (Page 12/50) When subsequent invocations occur on a container that has already been active and invoked at least once before.\n- __How can you improve the performance of your function code when a warm container is invoked?__ (Page 33/50)\n  - Store configuration/dependencies your code retrieves (after initial execution)\n  - Use global/static variables \u0026 singletons. Limit reinitialization of variables/objects on every invocation.\n  - Keep alive and reuse connections (HTTP, database, etc.) that were established during a previous invocation.\n- Resource: [AWS Serverless Tools](https://aws.amazon.com/serverless)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodneyshag%2Faws_lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodneyshag%2Faws_lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodneyshag%2Faws_lambda/lists"}