Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Could not find a valid profile name #210

@lionelmace

Description

@lionelmace

I just faced the following issue

Error: Invalid function argument
on .terraform/modules/create_profile_attachment_cis/modules/attachment/main.tf line 38, in locals:
  validate_profile_name = length(local.sorted_list) == 0 ? tobool("Could not find a valid profile name ${var.profile_name}") : true
while calling tobool(v)
var.profile_name is "CIS IBM Cloud Foundations Benchmark v1.1.0"
Invalid value for "v" parameter: cannot convert "Could not find a valid profile name CIS IBM Cloud Foundations Benchmark v1.1.0" to bool; only the strings "true" or "false" are allowed.

with the .tf script below


module "create_profile_attachment_cis" {
  source                 = "terraform-ibm-modules/scc/ibm//modules/attachment"
  profile_name           = "CIS IBM Cloud Foundations Benchmark v1.1.0"
  profile_version        = "latest"
  scc_instance_id        = ibm_resource_instance.scc_instance.guid
  attachment_name        = format("%s-%s", local.basename, "attachment-cis")
  attachment_description = "profile-attachment-description"
  attachment_schedule    = "daily"
  # scope the attachment to the account
  scope = [{
    environment = "ibm-cloud"
    properties = [
      {
        name  = "scope_type"
        value = "account"
      },
      {
        name  = "scope_id"
        value = local.account_id
      }
    ]
  }]
}

Full code is available at https://github.com/lionelmace/ibm-cloud-native/blob/main/terraform/security-scc-scan-attachment.tf

It was working yesterday...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions