Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider consolidating CSP specific structs into single package #70

Open
inkel opened this issue Dec 4, 2023 · 2 comments
Open

Consider consolidating CSP specific structs into single package #70

inkel opened this issue Dec 4, 2023 · 2 comments

Comments

@inkel
Copy link
Collaborator

inkel commented Dec 4, 2023

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 just GCP
  • github.com/grafana/unused/gcp#NewProvider -> github.com/grafana/unused#NewGCPProvider
@Pokom
Copy link
Contributor

Pokom commented Dec 12, 2023

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.

@inkel
Copy link
Collaborator Author

inkel commented Dec 13, 2023

🤔 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants