I am trying to introduce step functions + lambda functions to the organisation. we are a .net shop (.net core + Visual Studio + Azure Devops for version control) We maintain 4 branches of our code DEV/QA/STAGE/PROD and use pipelines for deployment.
Question: How do I deploy a SAM from Azure DevOps so that I can have a DEV version(respectively QA/STG) of my step function + Lambda functions that does not affect production
Some of the solutions I have been considering are:
Pass the environment to the step function in the input and build arn of the lambda on the fly based on the environment (add :[environment] at the end of the lambda function arn)
Use some type of versioning of the step function, maybe even having a different one per environment - This will quadruple at best the number of step functions I need to maintain
Use choice steps to call different arn base on the input - this adds complexity and quadruple my code in the step function
My step function is executed from code using the AWS SDK and the invocation can easily either pass an en environment variable or execute a different step function based on the branch and value stored in app config
In addition, I would like to know how do I create a deployment pipeline code (presumably using the CLI, to create or move my ALIASES to the version of currently attached to the previous environment. The idea would be deploy $Latest -> attach DEV to $Latest When pushing to QA, simply move the "QA" Alias to the same version as DEV points to, when deploying to STAGE, move the ALIAS to the QA version etc.