terraform provider for multipass
What are you trying to do? I want to use multipass with terraform:
- launch instances (with or without cloud-init)
- query instance info
- list available instances
- mount a host directory into an instance
What's your proposed solution? Make a terraform provider that implements terraform resources and data sources for multipass.
Additional context If multipass is supposed to be a 'small cloud deployment on your laptop or workstation' then one should be able to use de-facto standard cloud provisioning tools like terraform (or pulumi, using a terraform provider) with it.
FYI a comparable project for a terraform provider is the libvirt provider: https://github.com/dmacvicar/terraform-provider-libvirt
So I can already manage VM-s on linux with that provider, I would like to use multipass though, since it also works on macos and windows.
I agree. I would like to have a Provider supports Multipass on my laptop
I am not really well versed in terraform providers but from my understanding it needs to connect to an API which multipass lacks AFAIK so instead I managed to create a terraform module managing multipass https://github.com/roiterorh/multipass-terraform it works but still need some improvement as there is no update on ressources FTM
Providers don't need an API to call, they just need to PROVIDE an API towards terraform. Eg. you can create files with it:, there's no API per-se for that one. https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file
Right now I'm trying to fill in the gap with https://registry.terraform.io/providers/scottwinkler/shell/latest/docs for tools that don't have an official provider.
Yes, a terraform provider for multipass would be great!
any updates on this one perhaps ?
@xinity, @all, this is probably not the right place for this. We have no relationship with terraform, it's the community there you'd need to get behind this idea. We're all for it here :)
Let's try then 😁
I came here in search of such a provider, and meanwhile found https://github.com/larstobi/terraform-provider-multipass which seems promising. There are a few missing features there, so if anyone is interested, we could redirect some love towards that project, instead of waiting for a new one to emerge.
For anyone still interested in a Terraform provider for Multipass with more features, I ended up rolling my own.
GitHub: https://github.com/todoroff/terraform-provider-multipass
Terraform Registry: https://registry.terraform.io/providers/todoroff/multipass/latest
It supports:
- multiple NICs and host mounts at launch
- inline, file-based, or template-based cloud-init
- managing named snapshots as first-class resources (create/delete/import)
- creating aliases as resources for ergonomic CLI entry points
- file upload/download using resource semantics (no ad-hoc provisioners needed)
- auto-recovery for instances soft-deleted outside of Terraform
- inspecting instances, images, networks, and snapshots via data sources
Impressive stuff @todoroff, thanks for sharing!