Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SLK-73211 - Change split separator for role mapping #253

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions aquasec/resource_role_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func resourceRoleMapping() *schema.Resource {
Schema: map[string]*schema.Schema{
"role_mapping": {
Type: schema.TypeMap,
Description: "Role Mapping is used to define the IdP role that the user will assume in Aqua",
Description: "Role Mapping is used to define the IdP role that the user will assume in Aqua. Use '|' as a separator for multiple roles.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand All @@ -43,7 +43,7 @@ func resourceRoleMapping() *schema.Resource {
Schema: map[string]*schema.Schema{
"role_mapping": {
Type: schema.TypeMap,
Description: "Role Mapping is used to define the IdP role that the user will assume in Aqua",
Description: "Role Mapping is used to define the IdP role that the user will assume in Aqua. Use '|' as a separator for multiple roles.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand All @@ -62,7 +62,7 @@ func resourceRoleMapping() *schema.Resource {
Schema: map[string]*schema.Schema{
"role_mapping": {
Type: schema.TypeMap,
Description: "Role Mapping is used to define the IdP role that the user will assume in Aqua",
Description: "Role Mapping is used to define the IdP role that the user will assume in Aqua. Use '|' as a separator for multiple roles.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand All @@ -81,7 +81,7 @@ func resourceRoleMapping() *schema.Resource {
Schema: map[string]*schema.Schema{
"role_mapping": {
Type: schema.TypeMap,
Description: "Role Mapping is used to define the IdP role that the user will assume in Aqua",
Description: "Role Mapping is used to define the IdP role that the user will assume in Aqua. Use '|' as a separator for multiple roles.",
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand Down
2 changes: 1 addition & 1 deletion aquasec/resource_sso.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
9 changes: 5 additions & 4 deletions docs/resources/role_mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ resource "aquasec_role_mapping" "role_mapping" {
saml {
role_mapping = {
Administrator = "group1"
Scanner = "group2|group3"
}
}
}
Expand Down Expand Up @@ -45,28 +46,28 @@ output "role_mapping" {

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.


<a id="nestedblock--oauth2"></a>
### 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.


<a id="nestedblock--openid"></a>
### 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.


<a id="nestedblock--saml"></a>
### 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.
1 change: 1 addition & 0 deletions examples/resources/aquasec_role_mapping/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resource "aquasec_role_mapping" "role_mapping" {
saml {
role_mapping = {
Administrator = "group1"
Scanner = "group2|group3"
}
}
}
Expand Down
Loading