Can i output a provider from a module in terraform

terraform

I want to output a postgreql provider from a module in terraform then use it to further configure the database.

Current use case is a module creating a postgres rds instance and i want to return a "postgresql provider" to continue setting up the roles and databases.

Best Answer

No you cannot do that. You need to return the login values from the module so you can setup a provider outside the module using those values.

I would just edit the module and do what you need inside the module so you don't have to output those things.