Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting clients default roles using keycloak_default_roles gives error #930

Open
mustafaStakater opened this issue Feb 21, 2024 · 1 comment

Comments

@mustafaStakater
Copy link

Problem

Can we set client roles using tf resource keycloak_default_roles ?
i get the following error when creating an default role with client roles present.

keycloak_default_roles.default_roles: Creating...
╷
│ Error: defaultRoles not found by name
│ 
│   with keycloak_default_roles.default_roles,
│   on main.tf line 17, in resource "keycloak_default_roles" "default_roles":
│   17: resource "keycloak_default_roles" "default_roles" {
│ 
╵

Steps to reproduce

  • Get access to keycloak instance
  • Create main.tf that creates a simple realm and adds default roles belonging to client (view-groups belongs to account client)
    terraform {
      required_providers {
        keycloak = {
          source  = "mrparkers/keycloak"
          version = "4.4.0"
        }
      }
    }
    
    provider "keycloak" {
      client_id = "admin-cli"
      username  = "admin"
      password  = "mypassword"
      url       = "https://my.keycloak.instance"
    }
    resource "keycloak_realm" "realm" {
      realm   = "my-realm"
      enabled = true
    }
    
    resource "keycloak_default_roles" "default_roles" {
      realm_id      = keycloak_realm.realm.id
      default_roles = ["view-groups","uma_authorization"]
    }
    
  • Run terraform init and then terraform apply
@mustafaStakater
Copy link
Author

Theres a pull request for this already #764

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant