In this tutorial we will be using a repository in order to configure a terraform pipeline https://github.com/diggerhq/digger-gcp-lock-demo. In order to use GCP with Digger we follow the steps below:
Let’s create our first pull request with a change and see this in action:
Fork the demo repository
Enable Actions (by default workflows won’t trigger in a fork)
main.tf
and create a PR - this will create a lockdigger plan
- terraform plan output will be added as comment. If you don’t see a comment (bug) - check out job outputcreate another PR - plan or apply won’t work in this PR until the first lock is released
You should see Locked by PR #1
comment. The action logs will display “Project locked” error message.
Conclusion
In this tutorial we reused an existing sample repository to set up our first collaborative terraform environment which allows us to collaborate with our team and run terraform changes safely without conflicts.