lambda

AWS journey β€” API Gateway & Lambda & VPC performance

published on
We decided to hide some EC2 instances in private subnets (VPC). They’re accessible via bastion hosts or via API (API Gateway & Lambda). Works well, but there’s one weird issueβ€Šβ€”β€Šcold lambda start time is over 10s sometimes. We experienced even 15s. This is not acceptable and I’m seeking for answers to my questions. Does increased memory size help? Is this huge cold start time VPC related? Is there a difference when we do use another language? Read More...

AWS Lambda & API Gateway Error Handling

published on
It’s fragile and kind of terrible. Let’s look at it. We have a function named lambda. It has one argument named action (enum with allowed values data, exception or timeout). First thing we would like to do is to validate input via schema. Then we would like to return custom error message (and status code) if it’s invalid or do other things based on the action argument value. Here’s the code, just to demonstrate how it works. Read More...