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
1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 | |