Skip to main content

directories

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

Overview

Namedirectories
TypeResource
Idaws.clouddirectory.directories

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
creation_date_timestring (date-time)The date and time when the directory was created.
directory_arnstringThe Amazon Resource Name (ARN) that is associated with the directory. For more information, see arns.
namestringThe name of the directory. (pattern: <code>^[a-zA-Z0-9._-]*$</code>)
statestringThe state of the directory. Can be either Enabled, Disabled, or Deleted. (ENABLED, DISABLED, DELETED)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_directoryselectx-amz-data-partition, regionRetrieves metadata about a directory.
list_directoriesselectregionLists directories created within an account.
create_directoryinsertx-amz-data-partition, regionCreates a Directory by copying the published schema into the directory. A directory cannot be created without a schema. You can also quickly create a directory using a managed schema, called the QuickStartSchema. For more information, see Managed Schema in the Amazon Cloud Directory Developer Guide.
delete_directorydeletex-amz-data-partition, regionDeletes a directory. Only disabled directories can be deleted. A deleted directory cannot be undone. Exercise extreme caution when deleting directories.
upgrade_applied_schemaexecregion, PublishedSchemaArn, DirectoryArnUpgrades a single directory in-place using the PublishedSchemaArn with schema updates found in MinorVersion. Backwards-compatible minor version upgrades are instantaneously available for readers on all objects in the directory. Note: This is a synchronous API call and upgrades only one schema on a given directory per call. To upgrade multiple directories from one schema, you would need to call this API on each directory.

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)
x-amz-data-partitionstringThe ARN of the directory to delete.

SELECT examples

Retrieves metadata about a directory.

SELECT
creation_date_time,
directory_arn,
name,
state
FROM aws.clouddirectory.directories
WHERE `x-amz-data-partition` = '{{ x-amz-data-partition }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a Directory by copying the published schema into the directory. A directory cannot be created without a schema. You can also quickly create a directory using a managed schema, called the QuickStartSchema. For more information, see Managed Schema in the Amazon Cloud Directory Developer Guide.

INSERT INTO aws.clouddirectory.directories (
Name,
`x-amz-data-partition`,
region
)
SELECT
'{{ Name }}',
'{{ x-amz-data-partition }}',
'{{ region }}'
RETURNING
applied_schema_arn,
directory_arn,
name,
object_identifier
;

DELETE examples

Deletes a directory. Only disabled directories can be deleted. A deleted directory cannot be undone. Exercise extreme caution when deleting directories.

DELETE FROM aws.clouddirectory.directories
WHERE `x-amz-data-partition` = '{{ x-amz-data-partition }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Upgrades a single directory in-place using the PublishedSchemaArn with schema updates found in MinorVersion. Backwards-compatible minor version upgrades are instantaneously available for readers on all objects in the directory. Note: This is a synchronous API call and upgrades only one schema on a given directory per call. To upgrade multiple directories from one schema, you would need to call this API on each directory.

EXEC aws.clouddirectory.directories.upgrade_applied_schema
@region='{{ region }}' --required
@@json=
'{
"PublishedSchemaArn": "{{ PublishedSchemaArn }}",
"DirectoryArn": "{{ DirectoryArn }}",
"DryRun": {{ DryRun }}
}'
;