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

Profile version error for "latest" #202

@65156

Description

@65156

I get these errors with string value "latest" and for a specific version e.g 1.1.0 for profile version arg of the attachment module

2024/11/28 17:47:25 Terraform apply | Error: Invalid index
 2024/11/28 17:47:25 Terraform apply | 
 2024/11/28 17:47:25 Terraform apply |   on .terraform/modules/scc_profile/modules/attachment/main.tf line 39, in locals:
 2024/11/28 17:47:25 Terraform apply |   39:   latest_profile = local.sorted_list[length(local.sorted_list) - 1]
 2024/11/28 17:47:25 Terraform apply |     ├────────────────
 2024/11/28 17:47:25 Terraform apply |     │ local.sorted_list is empty tuple
 2024/11/28 17:47:25 Terraform apply | 
 2024/11/28 17:47:25 Terraform apply | The given key does not identify an element in this collection value: a
 2024/11/28 17:47:25 Terraform apply | negative number is not a valid index for a sequence.

Code

module "scc_profile" {
  for_each                       = { for entry in local.security_center_profiles : entry.id => entry }
  source                         = "terraform-ibm-modules/scc/ibm//modules/attachment"
  profile_name                   = each.value.profile_name
  profile_version                = "latest"
  use_profile_default_parameters = true
  scc_instance_id                = module.security_center[each.value.resource_instance].guid
  attachment_name                = each.value.attachment_name
  attachment_description         = each.value.attachment_description
  attachment_schedule            = each.value.attachment_schedule
  scope = [{
    environment = "ibm-cloud"
    properties = [{
        name  = "scope_type"
        value = "account"
      }]
  }]
}
...

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions