From fa52c542f6b1070103c53e725713706ef63f1a88 Mon Sep 17 00:00:00 2001 From: archinksagar <68829863+archinksagar@users.noreply.github.com> Date: Mon, 6 May 2024 15:37:03 -0400 Subject: [PATCH] Workspaces: Fix directory type (#7625) --- moto/workspaces/models.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/moto/workspaces/models.py b/moto/workspaces/models.py index 3b8e708619dc..86cdb5338871 100644 --- a/moto/workspaces/models.py +++ b/moto/workspaces/models.py @@ -58,7 +58,8 @@ def __init__( self.modification_states: List[ Dict[str, str] ] = [] # modify_workspace_properties - self.related_workspaces: List[Dict[str, str]] = [] # create_standy_workspace + # create_standy_workspace + self.related_workspaces: List[Dict[str, str]] = [] self.data_replication_settings: Dict[str, Any] = {} # The properties of the standby WorkSpace related to related_workspaces self.standby_workspaces_properties: List[Dict[str, Any]] = [] @@ -141,7 +142,13 @@ def __init__( self.dns_ip_addresses = directory.dns_ip_addrs self.customer_username = "Administrator" self.iam_rold_id = f"arn:aws:iam::{account_id}:role/workspaces_DefaultRole" - self.directory_type = directory.directory_type + dir_type = directory.directory_type + if dir_type == "ADConnector": + self.directory_type = "AD_CONNECTOR" + elif dir_type == "SimpleAD": + self.directory_type = "SIMPLE_AD" + else: + self.directory_type = dir_type self.workspace_security_group_id = security_group_id self.state = "REGISTERED" # Default values for workspace_creation_properties