Is it possible to run only one execution of a pipeline at once even if multiple commits happen over a short time?

I have a pipeline that executes some Terraform code, I only ever want one of these pipelines to run at any given time.

By default it seems that Circle will try to run a pipeline for each commit to a repo even if another one is already running, this causes any pipelines past the first one to fail since Terraform will not be able to obtain a state lock.

Is it possible to “lock” a pipeline so only one can run at any given time for a project/repo?

1 Like

Hi @lobsterdore

I strongly recommend that you manage state for your Terraform on terraform cloud. It’s def the cleanest way to enable Terraform within pipelines. You can reference this blog post on IaC + pipelines to learn a bit more about implementation.