Is it possible to automagically spawn a new database for every pull request created on GitHub ? I would like to have a Pull Request Preview Environment and I would like to have a small database for every one of these.
Hi Ludovik ! Welcome to the forum !
So, this can be done but it won’t be completely automagic
You can leverage GitHub Action combined with our Terraform provider. A GH Action can be triggered for a pull request and from there you can run a terraform resource.
I have some resources for you that might help you :
- A short video I made showing how GH Action works with our terraform provider ( + some GitOps but this out of scope : https://www.youtube.com/watch?v=r0nXCPYROlM&ab_channel=SebastienBlanc
- The related repo that contains the sample : GitHub - sebastienblanc/aiven-terraform-playground
Here , I’m using GH + Terraform for Kafka but spawning a DBs would be exactly the same approach.
Check also our Terraform documentation :
- Aiven Provider for Terraform - Aiven
- Our Terraform cookbook recipes : Search | Aiven Developer Center
Hope this helps and feel free to reach out for any questions but also to share your solution if you manage to make it work !