Search code examples
azure-devopsazure-pipelinesmultiple-repositories

How to trigger terraform deployment that resides in a separate repo with Azure Pipelines?


We have a nodejs application that has azure-pipelines file where it gets triggered by a PR and builds the image and sends it to ECR on AWS. We also have all our terraform AWS infrastructure code on a separate repo.

We want the terraform deployment to be triggered once the pipeline on the application repo finishes and image is pushed to the registry. What is a good way to achieve this?

Open to suggestions and recommendations. Thanks


Solution

  • You can use repository resource to checkout code from other repositories. From there, just run whatever steps you need to apply terraform scripts.

    There's also TriggerBuild task that you could use if you want to have a separate pipeline for that terraform.