Search code examples
aws-lambdaaws-step-functionsaws-codecommit

Store Step Function and Lamda in same code commit repo


I am creating a step function that orchestrates a lamda. The lamda has 4 simple endpoints.

I would like to save the lamda and step function in the same git repo. Regarding this:

  1. Is this good practice or should they be in separate repos on code commit?
  2. If this is good practice, what is the best way to manage the deploy pipeline - for two related projects in the same repo?

Solution

  • It is best practice to have actual code and necessary infrastructure code in same repo.

    Creating infrastructure as code:

    There are many options, couple of widely used ones are:

    In general writing CDK code is easier than cloudformation and writing step functions in CDK is a million times easier.

    So, my recommendation is to write CDK code to create Lambda functions and step functions.

    Build & Deploy:

    We can use AWS CodeBuild to build artifacts and AWS CodePipeline to orchestrate.