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

**************************
associate_connection_alias
**************************



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

  

  Associates the specified connection alias with the specified directory to enable cross-Region redirection. For more information, see `Cross-Region Redirection for Amazon WorkSpaces <https://docs.aws.amazon.com/workspaces/latest/adminguide/cross-region-redirection.html>`__.

   

  .. note::

    

    Before performing this operation, call `DescribeConnectionAliases <https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeConnectionAliases.html>`__ to make sure that the current state of the connection alias is ``CREATED``.

    

  

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


  **Request Syntax**
  ::

    response = client.associate_connection_alias(
        AliasId='string',
        ResourceId='string'
    )
    
  :type AliasId: string
  :param AliasId: **[REQUIRED]** 

    The identifier of the connection alias.

    

  
  :type ResourceId: string
  :param ResourceId: **[REQUIRED]** 

    The identifier of the directory to associate the connection alias with.

    

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

    
    ::

      {
          'ConnectionIdentifier': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ConnectionIdentifier** *(string) --* 

        The identifier of the connection alias association. You use the connection identifier in the DNS TXT record when you're configuring your DNS routing policies.

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

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

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

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

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

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

  