create_directory
async
¶
create_directory(
name: DirectoryName,
password: Password,
size: DirectorySize,
*,
config_overrides: Optional[AsyncDirectoryServiceClientConfig] = None,
short_name: Optional[DirectoryShortName] = None,
description: Optional[Description] = None,
vpc_settings: Optional[DirectoryVpcSettings] = None,
tags: Optional[Tags] = None,
network_type: Optional[NetworkType] = None,
) -> CreateDirectoryResult
Creates a Simple AD directory. For more information, see Simple Active Directory in the Directory Service Admin Guide.
Before you call CreateDirectory, ensure that all of the required permissions have been explicitly granted through a policy. For details about what permissions are required to run the CreateDirectory operation, see Directory Service API Permissions: Actions, Resources, and Conditions Reference.
Parameters:
-
name(DirectoryName) –The fully qualified name for the directory, such as
corp.example.com. -
short_name(Optional[DirectoryShortName], default:None) –The NetBIOS name of the directory, such as
CORP. -
password(Password) –The password for the directory administrator. The directory creation process creates a directory administrator account with the user name
Administratorand this password.If you need to change the password for the administrator account, you can use the ResetUserPassword API call.
The regex pattern for this string is made up of the following conditions:
-
Length (?=^.{8,64}$) – Must be between 8 and 64 characters
AND any 3 of the following password complexity rules required by Active Directory:
-
Numbers and upper case and lowercase (?=.*\d)(?=.*[A-Z])(?=.*[a-z])
-
Numbers and special characters and lower case (?=.*\d)(?=.*[^A-Za-z0-9\s])(?=.*[a-z])
-
Special characters and upper case and lower case (?=.*[^A-Za-z0-9\s])(?=.*[A-Z])(?=.*[a-z])
-
Numbers and upper case and special characters (?=.*\d)(?=.*[A-Z])(?=.*[^A-Za-z0-9\s])
For additional information about how Active Directory passwords are enforced, see Password must meet complexity requirements on the Microsoft website.
-
-
description(Optional[Description], default:None) –A description for the directory.
-
size(DirectorySize) –The size of the directory.
-
vpc_settings(Optional[DirectoryVpcSettings], default:None) –A DirectoryVpcSettings object that contains additional information for the operation.
-
tags(Optional[Tags], default:None) –The tags to be assigned to the Simple AD directory.
-
network_type(Optional[NetworkType], default:None) –The network type for your directory. Simple AD supports IPv4 and Dual-stack only.
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 create a Simple AD directory The following example creates a Simple AD directory.
>>> await client.create_directory(name='seattle.example.com', short_name='seattle', password='Str0ngP@ssw0rd', description='Regional directory for example.com', size='Small', vpc_settings={'SubnetIds': ['subnet-ba0146de', 'subnet-bef46bc8'], 'VpcId': 'vpc-45025421'})
Source code in docs_src/capo_directory_service/_services/async_directory_service.py
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 | |