Skip to main content

directories

Creates, updates, deletes, gets or lists a directories resource.

Overview

Namedirectories
TypeResource
Idaws.ds.directories

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
access_urlstringThe access URL for the directory, such as http:​//<alias>.awsapps.com. If no alias exists, <alias> is the directory identifier, such as d-XXXXXXXXXX.
aliasstringThe alias for the directory. If no alias exists, the alias is the directory identifier, such as d-XXXXXXXXXX. (pattern: <code>^(?!D-|d-)([\da-zA-Z]+)([-][\da-zA-Z])</code>)
connect_settingsobjectDirectoryConnectSettingsDescription object that contains additional information about an AD Connector directory. Present only for AD Connector directories.
descriptionstringThe description for the directory. (pattern: <code>^([a-zA-Z0-9_])[\a-zA-Z0-9_@#%+=:?./!\s-]$</code>)
desired_number_of_domain_controllersintegerThe desired number of domain controllers in the directory if the directory is Microsoft AD.
directory_idstringThe directory identifier. (pattern: <code>^d-[0-9a-f]{10}$</code>)
dns_ip_addrsarrayThe IP addresses of the DNS servers for the directory. For a Simple AD or Microsoft AD directory, these are the IP addresses of the Simple AD or Microsoft AD directory servers. For an AD Connector directory, these are the IP addresses of self-managed directory to which the AD Connector is connected.
dns_ipv_6_addrsarrayThe IPv6 addresses of the DNS servers for the directory. For a Simple AD or Microsoft AD directory, these are the IPv6 addresses of the Simple AD or Microsoft AD directory servers. For an AD Connector directory, these are the IPv6 addresses of the DNS servers or domain controllers in your self-managed directory to which the AD Connector is connected.
editionstringThe edition associated with this directory. (Enterprise, Standard, Hybrid)
hybrid_settingsobjectContains information about the hybrid directory configuration for the directory, including Amazon Web Services System Manager managed node identifiers and DNS IPs.
launch_timestring (date-time)The date and time when the directory was created.
namestringThe fully qualified name of the directory. (pattern: <code>^([a-zA-Z0-9]+[\.-])+([a-zA-Z0-9])+$</code>)
network_typestringThe network type of the directory. (Dual-stack, IPv4, IPv6)
os_versionstringThe operating system (OS) version of the directory. (SERVER_2012, SERVER_2019)
owner_directory_descriptionobjectDescribes the Managed Microsoft AD directory in the directory owner account.
radius_settingsobjectInformation about the RadiusSettings object configured for this directory.
radius_statusstringThe status of the RADIUS MFA server connection. (Creating, Completed, Failed)
regions_infoobjectLists the Regions where the directory has replicated.
share_methodstringThe method used when sharing a directory to determine whether the directory should be shared within your Amazon Web Services organization (ORGANIZATIONS) or with any Amazon Web Services account by sending a shared directory request (HANDSHAKE). (ORGANIZATIONS, HANDSHAKE)
share_notesstringA directory share request that is sent by the directory owner to the directory consumer. The request includes a typed message to help the directory consumer administrator determine whether to approve or reject the share invitation.
share_statusstringCurrent directory status of the shared Managed Microsoft AD directory. (Shared, PendingAcceptance, Rejected, Rejecting, RejectFailed, Sharing, ShareFailed, Deleted, Deleting)
short_namestringThe short name of the directory. (pattern: <code>^[^\/:?"<>|.]+[^\/:?"<>|]*$</code>)
sizestringThe directory size. (Small, Large)
sso_enabledbooleanIndicates whether single sign-on is enabled for the directory. For more information, see EnableSso and DisableSso.
stagestringThe current stage of the directory. (Requested, Creating, Created, Active, Inoperable, Impaired, Restoring, RestoreFailed, Deleting, Deleted, Failed, Updating)
stage_last_updated_date_timestring (date-time)The date and time when the stage was last updated.
stage_reasonstringAdditional information about the directory stage.
typestringThe directory type. (SimpleAD, ADConnector, MicrosoftAD, SharedMicrosoftAD)
vpc_settingsobjectA DirectoryVpcSettingsDescription object that contains additional information about a directory. Present only for Simple AD and Managed Microsoft AD directories.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_directoriesselectregionObtains information about the directories that belong to this account. You can retrieve information about specific directories by passing the directory identifiers in the DirectoryIds parameter. Otherwise, all directories that belong to the current account are returned. This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the DescribeDirectoriesResult.NextToken member contains a token that you pass in the next call to DescribeDirectories to retrieve the next set of items. You can also specify a maximum number of return results with the Limit parameter.
create_computerinsertregion, DirectoryId, ComputerName, PasswordCreates an Active Directory computer object in the specified directory.
create_aliasinsertregion, DirectoryIdCreates an alias for a directory and assigns the alias to the directory. The alias is used to construct the access URL for the directory, such as http:​//<alias>.awsapps.com. After an alias has been created, it cannot be deleted or reused, so this operation should only be used when absolutely necessary.
create_directoryinsertregion, PasswordCreates 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.
update_directory_setupupdateregion, DirectoryId, UpdateTypeUpdates directory configuration for the specified update type.
update_radiusupdateregion, DirectoryId, RadiusSettingsUpdates the Remote Authentication Dial In User Service (RADIUS) server information for an AD Connector or Microsoft AD directory.
delete_directorydeleteregionDeletes an Directory Service directory. Before you call DeleteDirectory, ensure that all of the required permissions have been explicitly granted through a policy. For details about what permissions are required to run the DeleteDirectory operation, see Directory Service API Permissions: Actions, Resources, and Conditions Reference.
cancel_schema_extensionexecregion, DirectoryId, SchemaExtensionIdCancels an in-progress schema extension to a Microsoft AD directory. Once a schema extension has started replicating to all domain controllers, the task can no longer be canceled. A schema extension can be canceled during any of the following states; Initializing, CreatingSnapshot, and UpdatingSchema.
disable_ca_enrollment_policyexecregion, DirectoryIdDisables the certificate authority (CA) enrollment policy for the specified directory. This stops automatic certificate enrollment and management for domain-joined clients, but does not affect existing certificates. Disabling the CA enrollment policy prevents new certificates from being automatically enrolled, but existing certificates remain valid and functional until they expire.
disable_client_authenticationexecregion, DirectoryIdDisables alternative client authentication methods for the specified directory.
disable_ldapsexecregion, DirectoryIdDeactivates LDAP secure calls for the specified directory.
disable_radiusexecregion, DirectoryIdDisables multi-factor authentication (MFA) with the Remote Authentication Dial In User Service (RADIUS) server for an AD Connector or Microsoft AD directory.
disable_ssoexecregion, DirectoryIdDisables single-sign on for a directory.
enable_ca_enrollment_policyexecregion, DirectoryId, PcaConnectorArnEnables certificate authority (CA) enrollment policy for the specified directory. This allows domain-joined clients to automatically request and receive certificates from the specified Amazon Web Services Private Certificate Authority. Before enabling CA enrollment, ensure that the PCA connector is properly configured and accessible from the directory. The connector must be in an active state and have the necessary permissions.
enable_client_authenticationexecregion, DirectoryIdEnables alternative client authentication methods for the specified directory.
enable_ldapsexecregion, DirectoryIdActivates the switch for the specific directory to always use LDAP secure calls.
enable_radiusexecregion, DirectoryId, RadiusSettingsEnables multi-factor authentication (MFA) with the Remote Authentication Dial In User Service (RADIUS) server for an AD Connector or Microsoft AD directory.
enable_ssoexecregion, DirectoryIdEnables single sign-on for a directory. Single sign-on allows users in your directory to access certain Amazon Web Services services from a computer joined to the directory without having to enter their credentials separately.
reset_user_passwordexecregion, DirectoryId, UserName, NewPasswordResets the password for any user in your Managed Microsoft AD or Simple AD directory. Disabled users will become enabled and can be authenticated following the API call. You can reset the password for any user in your directory with the following exceptions: For Simple AD, you cannot reset the password for any user that is a member of either the Domain Admins or Enterprise Admins group except for the administrator user. For Managed Microsoft AD, you can only reset the password for a user that is in an OU based off of the NetBIOS name that you typed when you created your directory. For example, you cannot reset the password for a user in the Amazon Web Services Reserved OU. For more information about the OU structure for an Managed Microsoft AD directory, see What Gets Created in the Directory Service Administration Guide.
share_directoryexecregion, DirectoryId, ShareTarget, ShareMethodShares a specified directory (DirectoryId) in your Amazon Web Services account (directory owner) with another Amazon Web Services account (directory consumer). With this operation you can use your directory from any Amazon Web Services account and from any Amazon VPC within an Amazon Web Services Region. When you share your Managed Microsoft AD directory, Directory Service creates a shared directory in the directory consumer account. This shared directory contains the metadata to provide access to the directory within the directory owner account. The shared directory is visible in all VPCs in the directory consumer account. The ShareMethod parameter determines whether the specified directory can be shared between Amazon Web Services accounts inside the same Amazon Web Services organization (ORGANIZATIONS). It also determines whether you can share the directory with any other Amazon Web Services account either inside or outside of the organization (HANDSHAKE). The ShareNotes parameter is only used when HANDSHAKE is called, which sends a directory sharing request to the directory consumer.
start_schema_extensionexecregion, DirectoryId, CreateSnapshotBeforeSchemaExtension, LdifContentApplies a schema extension to a Microsoft AD directory.
unshare_directoryexecregion, DirectoryId, UnshareTargetStops the directory sharing between the directory owner and consumer accounts.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Obtains information about the directories that belong to this account. You can retrieve information about specific directories by passing the directory identifiers in the DirectoryIds parameter. Otherwise, all directories that belong to the current account are returned. This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the DescribeDirectoriesResult.NextToken member contains a token that you pass in the next call to DescribeDirectories to retrieve the next set of items. You can also specify a maximum number of return results with the Limit parameter.

SELECT
access_url,
alias,
connect_settings,
description,
desired_number_of_domain_controllers,
directory_id,
dns_ip_addrs,
dns_ipv_6_addrs,
edition,
hybrid_settings,
launch_time,
name,
network_type,
os_version,
owner_directory_description,
radius_settings,
radius_status,
regions_info,
share_method,
share_notes,
share_status,
short_name,
size,
sso_enabled,
stage,
stage_last_updated_date_time,
stage_reason,
type,
vpc_settings
FROM aws.ds.directories
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates an Active Directory computer object in the specified directory.

INSERT INTO aws.ds.directories (
DirectoryId,
ComputerName,
Password,
OrganizationalUnitDistinguishedName,
ComputerAttributes,
region
)
SELECT
'{{ DirectoryId }}' /* required */,
'{{ ComputerName }}' /* required */,
'{{ Password }}' /* required */,
'{{ OrganizationalUnitDistinguishedName }}',
'{{ ComputerAttributes }}',
'{{ region }}'
RETURNING
computer
;

UPDATE examples

Updates directory configuration for the specified update type.

UPDATE aws.ds.directories
SET
DirectoryId = '{{ DirectoryId }}',
UpdateType = '{{ UpdateType }}',
OSUpdateSettings = '{{ OSUpdateSettings }}',
DirectorySizeUpdateSettings = '{{ DirectorySizeUpdateSettings }}',
NetworkUpdateSettings = '{{ NetworkUpdateSettings }}',
CreateSnapshotBeforeUpdate = {{ CreateSnapshotBeforeUpdate }}
WHERE
region = '{{ region }}' --required
AND DirectoryId = '{{ DirectoryId }}' --required
AND UpdateType = '{{ UpdateType }}' --required;

DELETE examples

Deletes an Directory Service directory. Before you call DeleteDirectory, ensure that all of the required permissions have been explicitly granted through a policy. For details about what permissions are required to run the DeleteDirectory operation, see Directory Service API Permissions: Actions, Resources, and Conditions Reference.

DELETE FROM aws.ds.directories
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Cancels an in-progress schema extension to a Microsoft AD directory. Once a schema extension has started replicating to all domain controllers, the task can no longer be canceled. A schema extension can be canceled during any of the following states; Initializing, CreatingSnapshot, and UpdatingSchema.

EXEC aws.ds.directories.cancel_schema_extension
@region='{{ region }}' --required
@@json=
'{
"DirectoryId": "{{ DirectoryId }}",
"SchemaExtensionId": "{{ SchemaExtensionId }}"
}'
;