api-gateway

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...