diff --git a/aquasec/resource_sso.go b/aquasec/resource_sso.go index c5f31c9..30354e5 100644 --- a/aquasec/resource_sso.go +++ b/aquasec/resource_sso.go @@ -356,7 +356,7 @@ func convertRoleMapping(m map[string]interface{}) map[string][]string { if len(m["role_mapping"].(map[string]interface{})) > 0 { for key, element := range m["role_mapping"].(map[string]interface{}) { - elementArry := strings.Split(element.(string), ",") + elementArry := strings.Split(element.(string), "|") roleMapping[key] = elementArry } } diff --git a/docs/resources/role_mapping.md b/docs/resources/role_mapping.md index 1cd1fc9..41da0e2 100644 --- a/docs/resources/role_mapping.md +++ b/docs/resources/role_mapping.md @@ -3,22 +3,21 @@ page_title: "aquasec_role_mapping Resource - terraform-provider-aquasec" subcategory: "" description: |- - + --- # aquasec_role_mapping (Resource) - - ## Example Usage ```terraform resource "aquasec_role_mapping" "role_mapping" { - saml { - role_mapping = { - Administrator = "group1" - } + saml { + role_mapping = { + Administrator = "group1" + Scanner = "group2|group3" } + } } output "role_mapping" { @@ -27,6 +26,7 @@ output "role_mapping" { ``` + ## Schema ### Optional @@ -41,34 +41,39 @@ output "role_mapping" { - `id` (String) The ID of this resource. + ### Nested Schema for `ldap` Required: -- `role_mapping` (Map of String) Role Mapping is used to define the IdP role that the user will assume in Aqua - +- `role_mapping` (Map of String) Role Mapping is used to define the IdP role that the user will assume in Aqua. Use "|" + as a separator for multiple roles. + ### Nested Schema for `oauth2` Required: -- `role_mapping` (Map of String) Role Mapping is used to define the IdP role that the user will assume in Aqua - +- `role_mapping` (Map of String) Role Mapping is used to define the IdP role that the user will assume in Aqua. Use "|" + as a separator for multiple roles. + ### Nested Schema for `openid` Required: -- `role_mapping` (Map of String) Role Mapping is used to define the IdP role that the user will assume in Aqua - +- `role_mapping` (Map of String) Role Mapping is used to define the IdP role that the user will assume in Aqua. Use "|" + as a separator for multiple roles. + ### Nested Schema for `saml` Required: -- `role_mapping` (Map of String) Role Mapping is used to define the IdP role that the user will assume in Aqua +- `role_mapping` (Map of String) Role Mapping is used to define the IdP role that the user will assume in Aqua. Use "|" + as a separator for multiple roles.