DirectoryService / Client / create_alias

create_alias#

DirectoryService.Client.create_alias(**kwargs)#

Creates an alias for a directory and assigns the alias to the directory. The alias is used to construct the access URL for the directory, such as http://<alias>.awsapps.com.

Warning

After an alias has been created, it cannot be deleted or reused, so this operation should only be used when absolutely necessary.

See also: AWS API Documentation

Request Syntax

response = client.create_alias(
    DirectoryId='string',
    Alias='string'
)
Parameters:
  • DirectoryId (string) –

    [REQUIRED]

    The identifier of the directory for which to create the alias.

  • Alias (string) –

    [REQUIRED]

    The requested alias.

    The alias must be unique amongst all aliases in Amazon Web Services. This operation throws an EntityAlreadyExistsException error if the alias already exists.

Return type:

dict

Returns:

Response Syntax

{
    'DirectoryId': 'string',
    'Alias': 'string'
}

Response Structure

  • (dict) –

    Contains the results of the CreateAlias operation.

    • DirectoryId (string) –

      The identifier of the directory.

    • Alias (string) –

      The alias for the directory.

Exceptions

  • DirectoryService.Client.exceptions.EntityAlreadyExistsException

  • DirectoryService.Client.exceptions.EntityDoesNotExistException

  • DirectoryService.Client.exceptions.InvalidParameterException

  • DirectoryService.Client.exceptions.ClientException

  • DirectoryService.Client.exceptions.ServiceException