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

Value Conversion Error #17

Open
awolfson2 opened this issue Oct 16, 2024 · 1 comment
Open

Value Conversion Error #17

awolfson2 opened this issue Oct 16, 2024 · 1 comment
Assignees

Comments

@awolfson2
Copy link

awolfson2 commented Oct 16, 2024

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
Copy link
Collaborator

mrmauer commented Oct 17, 2024

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

@mrmauer mrmauer self-assigned this Oct 17, 2024
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

2 participants