Skip to content

Commit

Permalink
Merge pull request #16589 from Tensho/fix-workspaces-directory-custom…
Browse files Browse the repository at this point in the history
…-security-group-id-default-ou

[aws_workspaces_directory] Fix Empty Custom Security Group ID & Default OU
  • Loading branch information
breathingdust committed Dec 8, 2020
2 parents e51f827 + ce1c1bc commit a7ce6a3
Show file tree
Hide file tree
Showing 2 changed files with 302 additions and 81 deletions.
14 changes: 11 additions & 3 deletions aws/resource_aws_workspaces_directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,21 @@ func expandWorkspaceCreationProperties(properties []interface{}) *workspaces.Wor

p := properties[0].(map[string]interface{})

return &workspaces.WorkspaceCreationProperties{
CustomSecurityGroupId: aws.String(p["custom_security_group_id"].(string)),
DefaultOu: aws.String(p["default_ou"].(string)),
result := &workspaces.WorkspaceCreationProperties{
EnableInternetAccess: aws.Bool(p["enable_internet_access"].(bool)),
EnableMaintenanceMode: aws.Bool(p["enable_maintenance_mode"].(bool)),
UserEnabledAsLocalAdministrator: aws.Bool(p["user_enabled_as_local_administrator"].(bool)),
}

if p["custom_security_group_id"].(string) != "" {
result.CustomSecurityGroupId = aws.String(p["custom_security_group_id"].(string))
}

if p["default_ou"].(string) != "" {
result.DefaultOu = aws.String(p["default_ou"].(string))
}

return result
}

func flattenSelfServicePermissions(permissions *workspaces.SelfservicePermissions) []interface{} {
Expand Down
Loading

0 comments on commit a7ce6a3

Please sign in to comment.