Comments (8)
Hi @trois-six, the role will not have any composite roles if you omit the composite_roles
attribute completely. Let me know if that works for you.
from terraform-provider-keycloak.
Yes that works, but if I have a role that have composite roles and I want to remove the composite roles, I can't.
from terraform-provider-keycloak.
Omitting the attribute should remove all of that role's composites, can you give me the HCL you're using and explain the behavior you're getting verses the behavior you're expecting?
from terraform-provider-keycloak.
Also, my acceptance tests explicitly cover this scenario (adding composite roles and removing them all) so if you're noticing some strange behavior, it's probably a bug that I'd like to get fixed.
from terraform-provider-keycloak.
OK I confirm that omitting the attribute remove all the role's composites. That's not usual for a Terraform resource but it works. Thank you !
from terraform-provider-keycloak.
I'm open to allowing users to specify an empty list of composite_roles
if that would make you feel better. I would also like to keep the behavior of removing composite roles if the attribute is not specified.
If this is something you want, you can re-open this issue and I'll work on it when I get a chance.
from terraform-provider-keycloak.
The way it is done, I can't use this resource inside a module with a default value, but I can workaround it for the moment.
from terraform-provider-keycloak.
That's a fair use case, I did not think about that.
I think with HCL2 you could do something like this (forgive me if the syntax is incorrect, I don't use HCL2 yet):
resource "keycloak_role" "role" {
realm_id = "master"
name = "test"
composite_roles = len(var.composites == 0) ? null : var.composites
}
I think with HCL1 (which is what I'm still using) you'd have to do something even worse due to the lack of the null
type:
resource "keycloak_role" "role" {
count = "${len(var.composites) == 0 ? 1 : 0}"
realm_id = "master"
name = "test"
}
resource "keycloak_role" "role_with_composites" {
count = "${len(var.composites) == 0 ? 0 : 1}"
realm_id = "master"
name = "test"
composite_roles = "${var.composites}"
}
In either case, I agree that it is silly to have to add logic to your HCL because the provider won't allow you to specify an empty list for this attribute.
Thanks for helping me understand your use case, I'll work on this when I have some free time.
from terraform-provider-keycloak.
Related Issues (20)
- resource "keycloak_default_roles" doesn't support adding client roles HOT 2
- Add connection pooling support for keycloak_ldap_user_federation
- Importing clients / roles does not update realm_id correctly HOT 1
- Condition user - attribute HOT 1
- Add support to add `protocolMapper` to realm client scope HOT 2
- Support 'agggreate attributes' for SAML User Attribute Protocol Mappers
- Keycloak version >= 24 support? HOT 8
- keycloak_realm_user_profile: should support 'unmanagedAttributePolicy' HOT 4
- CVE-2023-45288 - GO-2024-2687 HOT 1
- CVE-2024-24786 - GHSA-8r3f-844c-mc37 HOT 1
- Malformed version with RedHat Build of Keycloak (RHBK) HOT 3
- Inconsistency in Group Sorting in keycloak_openid_client_group_policy Causes Random Drift in Terraform Provider HOT 1
- error provider
- resource missing
- Terraform provider (client credentials grant) having issue HOT 1
- Support SAML Client in terraformer
- Update GO HOT 1
- `keycloak_openid_audience_protocol_mapper`: Unpaginated request to `/admin/realms/${realm}/clients`
- The private_key schema element of the keycloak_realm_keystore_rsa resource must be sensitive HOT 1
- The health of this repo, an open discussion. HOT 19
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-keycloak.