AWS SAM package with multiple docker images

44 Views Asked by At

I have a few AWS Lambda functions in a single repo that I use AWS SAM to package up with the following command in my buildspec.yml file

sam package --template template.yml --s3-bucket "$S3_BUCKET" --output-template-file template-export.yml --region ${AWS_REGION} --image-repository $ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/$DOCKER_IMAGE

One of my functions runs on a docker image, and the above command builds it fine! However, I now need to add a second function that runs on a container, and I can't find anywhere online how to build the second Lambda. Is there a pattern for this case?

I have a Docker image for each lambda that runs the commands

CMD ["lambdas.lambda1.index.handler"]
0

There are 0 best solutions below