Refresher: serverless framework local development workflow

It’s been a while since I’ve written any notes about the Serverless framework, so here’s a few notes as a refresher on typical steps I use for local development. As a reminder to self, regions I typically deploy to are: AWS regions are listed here. To deploy: serverless deploy –region eu-west-2 To invoke local: serverless …

serverless framework remove error: “An error occurred: xyzRole – Cannot delete entity, must detach all policies first.”

Attempting a ‘serverless remove’ on a deployed error, I got this unexpected error I haven’t seen before: An error occurred: xyzRole – Cannot delete entity, must detach all policies first. A quick Google found an issue with the same error and an explanation. There is another policy attached to this Lambda that was not added …

Using Serverless Framework to build and deploy Docker images for AWS Lambdas

AWS Lambdas can be packaged and deployed using a Docker image, described in the docs here. Serverless Framework makes building and deploying a Docker based Lambda incredibly simple. If you have a simplest Dockerfile like this (from the docs here): FROM public.ecr.aws/lambda/nodejs:14 # Assumes your function is named “app.js”, and there is a package.json file …