I have a CodePipeline (that has CodeCommit source stage and then CodeBuild stage that compiles and then runs AWS CDK deploy). I want this pipeline to trigger on each commit to master, which it does. But the problem is that if the previous deploy (Cloudformation) is still running, the next build will fail.
I can't find a way to set concurrent builds to 1 on CodeBuild or CodePipeline. Is my only option to write a shell script to check the state of the Cloudformation stack and wait until it returns ok before starting the CDK deploy in the CodeBuild stage?