connect_directory
async
¶
connect_directory(
name: DirectoryName,
password: ConnectPassword,
size: DirectorySize,
connect_settings: DirectoryConnectSettings,
*,
config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
short_name: Optional[DirectoryShortName] = None,
description: Optional[Description] = None,
tags: Optional[Tags] = None,
network_type: Optional[NetworkType] = None,
) -> ConnectDirectoryResult
Creates an AD Connector to connect to a self-managed directory.
Before you call ConnectDirectory, ensure that all of the required permissions have been explicitly granted through a policy. For details about what permissions are required to run the ConnectDirectory operation, see Directory Service API Permissions: Actions, Resources, and Conditions Reference.
Parameters:
-
name(DirectoryName) –The fully qualified name of your self-managed directory, such as
corp.example.com. -
short_name(Optional[DirectoryShortName], default:None) –The NetBIOS name of your self-managed directory, such as
CORP. -
password(ConnectPassword) –The password for your self-managed user account.
-
description(Optional[Description], default:None) –A description for the directory.
-
size(DirectorySize) –The size of the directory.
-
connect_settings(DirectoryConnectSettings) –A DirectoryConnectSettings object that contains additional information for the operation.
-
tags(Optional[Tags], default:None) –The tags to be assigned to AD Connector.
-
network_type(Optional[NetworkType], default:None) –The network type for your directory. The default value is
IPv4orIPv6based on the provided subnet capabilities.
Raises:
-
ClientException–A client exception has occurred.
-
DirectoryLimitExceededException–The maximum number of directories in the region has been reached. You can use the GetDirectoryLimits operation to determine your directory limits in the region.
-
InvalidParameterException–One or more parameters are not valid.
-
ServiceException–An exception has occurred in Directory Service.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To connect to an on-premises directory The following example creates an AD Connector to connect to an on-premises directory.
>>> await client.connect_directory(name='corp.example.com', short_name='corp', password='Str0ngP@ssw0rd', description='Connector to corp', size='Small', connect_settings={'CustomerUserName': 'Administrator', 'VpcId': 'vpc-45025421', 'SubnetIds': ['subnet-ba0146de', 'subnet-bef46bc8'], 'CustomerDnsIps': ['172.30.21.228']})
Source code in docs_src/capo_directory_service/_services/async_directory_service.py
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 | |