:doc:`WorkSpaces <../../workspaces>` / Client / register_workspace_directory

****************************
register_workspace_directory
****************************



.. py:method:: WorkSpaces.Client.register_workspace_directory(**kwargs)

  

  Registers the specified directory. This operation is asynchronous and returns before the WorkSpace directory is registered. If this is the first time you are registering a directory, you will need to create the workspaces_DefaultRole role before you can register a directory. For more information, see `Creating the workspaces_DefaultRole Role <https://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-access-control.html#create-default-role>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RegisterWorkspaceDirectory>`_  


  **Request Syntax**
  ::

    response = client.register_workspace_directory(
        DirectoryId='string',
        SubnetIds=[
            'string',
        ],
        EnableSelfService=True|False,
        Tenancy='DEDICATED'|'SHARED',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        WorkspaceDirectoryName='string',
        WorkspaceDirectoryDescription='string',
        UserIdentityType='CUSTOMER_MANAGED'|'AWS_DIRECTORY_SERVICE'|'AWS_IAM_IDENTITY_CENTER',
        IdcInstanceArn='string',
        MicrosoftEntraConfig={
            'TenantId': 'string',
            'ApplicationConfigSecretArn': 'string'
        },
        WorkspaceType='PERSONAL'|'POOLS',
        ActiveDirectoryConfig={
            'DomainName': 'string',
            'ServiceAccountSecretArn': 'string'
        }
    )
    
  :type DirectoryId: string
  :param DirectoryId: 

    The identifier of the directory. You cannot register a directory if it does not have a status of Active. If the directory does not have a status of Active, you will receive an InvalidResourceStateException error. If you have already registered the maximum number of directories that you can register with Amazon WorkSpaces, you will receive a ResourceLimitExceededException error. Deregister directories that you are not using for WorkSpaces, and try again.

    

  
  :type SubnetIds: list
  :param SubnetIds: 

    The identifiers of the subnets for your virtual private cloud (VPC). Make sure that the subnets are in supported Availability Zones. The subnets must also be in separate Availability Zones. If these conditions are not met, you will receive an OperationNotSupportedException error.

    

  
    - *(string) --* 

    

  :type EnableSelfService: boolean
  :param EnableSelfService: 

    Indicates whether self-service capabilities are enabled or disabled.

    

  
  :type Tenancy: string
  :param Tenancy: 

    Indicates whether your WorkSpace directory is dedicated or shared. To use Bring Your Own License (BYOL) images, this value must be set to ``DEDICATED`` and your Amazon Web Services account must be enabled for BYOL. If your account has not been enabled for BYOL, you will receive an InvalidParameterValuesException error. For more information about BYOL images, see `Bring Your Own Windows Desktop Images <https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html>`__.

    

  
  :type Tags: list
  :param Tags: 

    The tags associated with the directory.

    

  
    - *(dict) --* 

      Describes a tag.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        The key of the tag.

        

      
      - **Value** *(string) --* 

        The value of the tag.

        

      
    

  :type WorkspaceDirectoryName: string
  :param WorkspaceDirectoryName: 

    The name of the directory to register.

    

  
  :type WorkspaceDirectoryDescription: string
  :param WorkspaceDirectoryDescription: 

    Description of the directory to register.

    

  
  :type UserIdentityType: string
  :param UserIdentityType: 

    The type of identity management the user is using.

    

  
  :type IdcInstanceArn: string
  :param IdcInstanceArn: 

    The Amazon Resource Name (ARN) of the identity center instance.

    

  
  :type MicrosoftEntraConfig: dict
  :param MicrosoftEntraConfig: 

    The details about Microsoft Entra config.

    

  
    - **TenantId** *(string) --* 

      The identifier of the tenant.

      

    
    - **ApplicationConfigSecretArn** *(string) --* 

      The Amazon Resource Name (ARN) of the application config.

      

    
  
  :type WorkspaceType: string
  :param WorkspaceType: 

    Indicates whether the directory's WorkSpace type is personal or pools.

    

  
  :type ActiveDirectoryConfig: dict
  :param ActiveDirectoryConfig: 

    The active directory config of the directory.

    

  
    - **DomainName** *(string) --* **[REQUIRED]** 

      The name of the domain.

      

    
    - **ServiceAccountSecretArn** *(string) --* **[REQUIRED]** 

      Indicates the secret ARN on the service account.

      

    
  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'DirectoryId': 'string',
          'State': 'REGISTERING'|'REGISTERED'|'DEREGISTERING'|'DEREGISTERED'|'ERROR'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **DirectoryId** *(string) --* 

        The identifier of the directory.

        
      

      - **State** *(string) --* 

        The registration status of the WorkSpace directory.

        
  
  **Exceptions**
  
  *   :py:class:`WorkSpaces.Client.exceptions.InvalidParameterValuesException`

  
  *   :py:class:`WorkSpaces.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`WorkSpaces.Client.exceptions.ResourceLimitExceededException`

  
  *   :py:class:`WorkSpaces.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`WorkSpaces.Client.exceptions.WorkspacesDefaultRoleNotFoundException`

  
  *   :py:class:`WorkSpaces.Client.exceptions.InvalidResourceStateException`

  
  *   :py:class:`WorkSpaces.Client.exceptions.UnsupportedNetworkConfigurationException`

  
  *   :py:class:`WorkSpaces.Client.exceptions.OperationNotSupportedException`

  
  *   :py:class:`WorkSpaces.Client.exceptions.ResourceAlreadyExistsException`

  