terraform-provider-keycloak
terraform-provider-keycloak copied to clipboard
Custom User Federation config list value
Hi, I'm having trouble getting keycloak_custom_user_federation
to accept a list as a value in the config
argument to this provider. I've tried sending all the values as lists, just sending the one value I want as a list, and serializing as json. Did I miss something from the docs?
I'm using terraform 0.15.3 and terraform-provider-keycloak 3.1.1.
Thank you for this great plugin!!!
Unfortunately, map values in HCL are expected to have the same value type, so there is no way to do something like this:
config = {
foo = "bar"
hello = ["world", "again"]
}
However, we could try to treat this similarly to the attributes
field for the keycloak_user
resource, and define a separator like ##
so you can define list values. So it would look something like this:
config = {
foo = "bar"
hello = "world##again"
}
Which you could simplify like this:
config = {
foo = "bar"
hello = join("##", ["world", "again"])
}
Let me know if this approach works for you.
This would be much better than... nothing. :-)
:+1: for the Idea with the separator. Just hit the same issue. It's the only thing I can't get working with the provider so far. Great Work, Many thanks!
What came to my mind, wouldn't it make sense to encode them as serialized JSON Array? Would be a standard, so easier to generate proper payload, then with a custom separator.