Passing multiple values in a required attribute

Hi Team,

I am working on creating a password policy in Okta, which reads its attribute value from CSV file.

As in okta a password policy can be attached to multiple group, I am able to pass one value like this

groups_included = [okta_group.cigna_group[“okta_reportadmin”].id]

my okta_group resource creates multiple groups like okta_admin,okta_reportadmin and okta_orgadmin so on but I need to add some of these groups in the password policy.

In my csv file group_include column I have given two values which are pipe separated and tried split functionality like below but this does not work.

groups_included = [[split(“|”, each.value.groups_included)].id]

Is there a way we can add multiple groups to the password policy?

Below is the complete code:

resource “okta_policy_password” “passwordpolicy” {
for_each = { for inst in local.instancespassword : inst.passwordpolicy_id => inst }
name = each.value.name
description = each.value.description
status = each.value.status
auth_provider = each.value.auth_provider
password_min_length = each.value.password_min_length
password_min_uppercase = each.value.password_min_uppercase
password_min_symbol = each.value.password_min_symbol
groups_included = [[split(“|”, each.value.groups_included)].id]
//groups_included = [okta_group.cigna_group[“okta_reportadmin”].id]
//groups_included = okta_groups.getGroup.[“okta_reportadmin”].id
priority = each.value.priority
password_history_count = each.value.password_history_count
password_max_lockout_attempts = each.value.password_max_lockout_attempts
password_auto_unlock_minutes = each.value.password_auto_unlock_minutes
password_min_lowercase = each.value.password_min_lowercase
password_min_number = each.value.password_min_number
password_exclude_username = each.value.password_exclude_username
email_recovery = each.value.email_recovery
sms_recovery = each.value.sms_recovery
question_recovery = each.value.question_recovery
password_show_lockout_failures = each.value.password_show_lockout_failures
}

CSV File:
passwordpolicy_id,name,description,status,auth_provider,password_min_length,password_min_uppercase,password_min_symbol,groups_included,priority,password_history_count,password_max_lockout_attempts,password_auto_unlock_minutes,password_min_lowercase,password_min_number,password_exclude_username,email_recovery,sms_recovery,question_recovery,password_show_lockout_failures,password_change,password_reset
DenyReportAdminCigna,DenyReportReportAdminCigna,Terraformpasswordpolicy,ACTIVE,OKTA,8,1,1,okta_reportadmin|okta_admin,2,5,10,10,1,1,0,ACTIVE,ACTIVE,ACTIVE,1,ALLOW,ALLOW

Regards
Rahul Jha