Azure / terraform-azurerm-avm-res-dbforpostgresql-flexibleserver

MIT License
0 stars 4 forks source link

[AVM Module Issue]: database resource should be a submodule? #8

Open kewalaka opened 4 days ago

kewalaka commented 4 days ago

Check for previous/existing GitHub issues

Issue Type?

Bug

(Optional) Module Version

0.1.0

(Optional) Correlation Id

No response

Description

The preferred approach in recent AVM module updates has been to put child resources, such as the database, in a submodule.

alefteris commented 2 days ago

@kewalaka If the database becomes a submodule, it will be only just a wrapper of the azurerm_postgresql_database resource. There is nothing extra to add to it I think, such as to implement one of the interfaces for example. So unless there is a policy that applies to all AVM modules, I don't think making the database a submodule adds anything useful. The same exact arguments that you would provide to the azurerm resource would be needed for the submodule. Is there a benefit that I could not think of, for making the database a submodule?

kewalaka commented 1 day ago

That's a fair point.

One generic benefit I have seen with submodules is you can call them directly. The situation where you have split responsibility between the server instance creation (platforml and the database (app).

I haven't put much thought into whether this makes sense for this resource.

I can't see any ref to the use of submodules being a design pattern in the spec, so in lieu of that, the "does it add value" metric makes sense.