terraform-provider-postgresql icon indicating copy to clipboard operation
terraform-provider-postgresql copied to clipboard

Setting a map of default parameters for Role. Draft, WIP

Open wimi opened this issue 5 years ago • 1 comments

This is an initial draft of extension of Role resource with map of default parameters.

The idea is to extend Role with the following section:

resource "postgresql_role" "sub_role" {
	name = "sub_role"
	roles = [
		"${postgresql_role.myrole2.id}",
		"${postgresql_role.role_simple.id}",
	]
	parameters = {
		application_name = "My app"
		role = "${postgresql_role.myrole2.id}"
	}
}

Parameters is a string->string map. I'm not sure yet how exactly will behave parameters of other types. We would expect in this section no parameter that are currently implemented by standalone Role attribute property - as then scenario complicates a lot (it is the same parameter store in database).

I've implemented very rough draft - let's discuss 😄 There is only one super simple test - it's too late now to go further, so I'm leaving this as is. Any comments to code are welcome as well (I'm golang beginner).

wimi avatar Jul 04 '20 01:07 wimi

Added test cases to showcase providing functionality from #132 and #150

wimi avatar Jul 04 '20 07:07 wimi