Skip to content

Error: Invalid function argument #140

@ocofaigh

Description

@ocofaigh

Seen in this run: https://github.com/terraform-ibm-modules/terraform-ibm-cloudability-onboarding/actions/runs/19705487721/job/56452323681

│ Error: Invalid function argument
│ 
│   on modules/cloudability-bucket-access/main.tf line 43, in locals:
│   43:   validate_custom_role = local.custom_role == null ? (var.use_existing_iam_custom_role ? tobool("Custom role `${var.cloudability_iam_custom_role_name}` not found in an account. Found ${join(",", [for role in data.ibm_iam_roles.cos_custom_role[0].roles : role.name])}") : tobool("Custom role name is not defined")) : null
│     ├────────────────
│     │ while calling tobool(v)
│     │ data.ibm_iam_roles.cos_custom_role[0].roles is list of object with 14 elements
│     │ var.cloudability_iam_custom_role_name is "CldyStorageDefaultTest"
│ 
│ Invalid value for "v" parameter: cannot convert "Custom role
│ `CldyStorageDefaultTest` not found in an account. Found Service
│ Configuration Reader,Viewer,Administrator,Operator,Editor,Key
│ Manager,Writer,Reader,Manager,Content Reader,Object Reader,Object
│ Writer,Backup Manager,Backup Reader" to bool; only the strings "true" or
│ "false" are allowed.
╵
╷
│ Error: Null value found in list
│ 
│   with module.cloudability_bucket_access[0].ibm_iam_service_policy.cos_bucket_policy[0],
│   on modules/cloudability-bucket-access/main.tf line 49, in resource "ibm_iam_service_policy" "cos_bucket_policy":
│   49:   roles  = [local.custom_role]
│ 
│ Null values are not allowed for this attribute value.
╵}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions