Skip to content
This repository was archived by the owner on Nov 14, 2020. It is now read-only.

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

Draft
wimi wants to merge 4 commits intohashicorp:masterfrom
wimi:parameters
Draft

Setting a map of default parameters for Role. Draft, WIP#155
wimi wants to merge 4 commits intohashicorp:masterfrom
wimi:parameters

Conversation

@wimi
Copy link
Copy Markdown

@wimi wimi commented Jul 4, 2020

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
Copy link
Copy Markdown
Author

wimi commented Jul 4, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant