- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ConnectDirectoryCommand
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 .
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DirectoryServiceClient, ConnectDirectoryCommand } from "@aws-sdk/client-directory-service"; // ES Modules import
// const { DirectoryServiceClient, ConnectDirectoryCommand } = require("@aws-sdk/client-directory-service"); // CommonJS import
const client = new DirectoryServiceClient(config);
const input = { // ConnectDirectoryRequest
Name: "STRING_VALUE", // required
ShortName: "STRING_VALUE",
Password: "STRING_VALUE", // required
Description: "STRING_VALUE",
Size: "Small" || "Large", // required
ConnectSettings: { // DirectoryConnectSettings
VpcId: "STRING_VALUE", // required
SubnetIds: [ // SubnetIds // required
"STRING_VALUE",
],
CustomerDnsIps: [ // DnsIpAddrs // required
"STRING_VALUE",
],
CustomerUserName: "STRING_VALUE", // required
},
Tags: [ // Tags
{ // Tag
Key: "STRING_VALUE", // required
Value: "STRING_VALUE", // required
},
],
};
const command = new ConnectDirectoryCommand(input);
const response = await client.send(command);
// { // ConnectDirectoryResult
// DirectoryId: "STRING_VALUE",
// };
ConnectDirectoryCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
ConnectSettings Required | DirectoryConnectSettings | undefined | A DirectoryConnectSettings object that contains additional information for the operation. |
Name Required | string | undefined | The fully qualified name of your self-managed directory, such as |
Password Required | string | undefined | The password for your self-managed user account. |
Size Required | DirectorySize | undefined | The size of the directory. |
Description | string | undefined | A description for the directory. |
ShortName | string | undefined | The NetBIOS name of your self-managed directory, such as |
Tags | Tag[] | undefined | The tags to be assigned to AD Connector. |
ConnectDirectoryCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
DirectoryId | string | undefined | The identifier of the new directory. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
ClientException | client | A client exception has occurred. |
DirectoryLimitExceededException | client | 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 | client | One or more parameters are not valid. |
ServiceException | server | An exception has occurred in Directory Service. |
DirectoryServiceServiceException | Base exception class for all service exceptions from DirectoryService service. |