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
781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 | |