Open inkel opened 7 months ago
I guess it's going to depend on the future goals, and if there are plans to extend unused
to other resources such as loadbalancers, service accounts, SQL instances etc. If so, each CSP exist in it's own package makes sense and isn't a level of indirection. If they exist within the same one, it's pretty easy for a developer to start pulling resources between providers and creating tight coupling between them. Having them as dedicated modules doesn't necessarily prevent this from happening, but makes it much more intentional as cyclical dependencies will become obvious during compilation.
🤔 yeah, I think you're right. In fact we could turn each provider package into its own Go module and release different versions for each one of them.
Currently all 3 implemented CSPs have their own package:
github.com/grafana/unused/gcp
github.com/grafana/unused/aws
github.com/grafana/unused/azure
While this could be seen as a good idea it currently isn't, and it just adds additional indirection. This could be easily solved by making relatively small changes like the following (using GCP as an example):
github.com/grafana/unused/gcp#Disk
->github.com/grafana/unused#GCPDisk
github.com/grafana/unused/gcp#Provider
->github.com/grafana/unused#GCPProvider
or even justGCP
github.com/grafana/unused/gcp#NewProvider
->github.com/grafana/unused#NewGCPProvider