PropelAuth / terraform-provider-propelauth

Use Terraform to manage your PropelAuth integration for authentication, B2B authorization, and user management.
https://registry.terraform.io/providers/PropelAuth/propelauth/latest/docs
0 stars 0 forks source link

Value Conversion Error #17

Open awolfson2 opened 1 month ago

awolfson2 commented 1 month ago

Resource propelauth_roles_and_permissions

Description: This is just an example, but I want to define roles and permissions as variables and when I try and use those variables inside the resource, it gives me this error. Please note in this example, my type is a list of strings (as defined in docs). If I place the list inside the resource, it works. If the list is defined as a var and i reference the variable, This type of error pops up. This error came up for permissoins, roles, and role_hierarchy.

Error:

│ Error: Value Conversion Error
│ 
│   with module.propelauth.propelauth_roles_and_permissions.pando,
│   on .terraform/modules/propelauth/propelauth/roles_and_permissions.tf line 121, in resource "propelauth_roles_and_permissions" "pando":
│  121:   role_hierarchy = var.roles
│ 
│ An unexpected error was encountered trying to build a value. This is always an error in the provider. Please report the following to the
│ provider developer:
│ 
│ Received unknown value, however the target type cannot handle unknown values. Use the corresponding `types` package type or a custom type that
│ handles unknown values.
│ 
│ Path: role_hierarchy
│ Target Type: []basetypes.StringValue
│ Suggested Type: basetypes.ListValue

example var.roles:

variable "roles" {
  type = list(string)
  default = [
    "Guest",
    "Admin",
    "QA",
    "General"
  ]
}
mrmauer commented 1 month ago

Thanks for the report, @awolfson2 . We'll take a closer look and get back to you.