Deploy lambdas in parallel with CodeBuild

0

I have a CodePipeline configured with my single GitHub repo to trigger build & deploy on any commit.

My repo contains dozens of individual lambda functions.

The pre_build step does a full clean & restore. Then in the build step, I have a long list of commands like this:

- dotnet build -c Debug
- cd folder1
- dotnet lambda deploy-function --configuration Debug --region $Region --config-file aws-lambda-tools-test.json
- cd ../folder2
- dotnet lambda deploy-function --configuration Debug --region $Region --config-file aws-lambda-tools-test.json
- cd ../folder3
- dotnet lambda deploy-function --configuration Debug --region $Region --config-file aws-lambda-tools-test.json

My question is, is there any way for me to execute these deployments in parallel?

2 Answers
1
Accepted Answer

CodeBuild batch support a matrix build where a build matrix defines tasks with different configurations that run in parallel. CodeBuild creates a separate build for each possible configuration combination.

Consider extending your pipeline to include CodeDeploy which supports deployment groups for grouping AWS Lambda functions in a CodeDeploy deployment.

RoB
answered 2 years ago
  • Matrix build (and the other options outlined in that linked doc) is what I was looking for. Thanks.

-3

I would suggest to pick CodeBuild compute type to support the required parallelism, and then use a Makefile with parallel execution.

AWS
Alex_P
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions