directories
Creates, updates, deletes, gets or lists a directories resource.
Overview
| Name | directories |
| Type | Resource |
| Id | aws.clouddirectory.directories |
Fields
The following fields are returned by SELECT queries:
- get_directory
- list_directories
| Name | Datatype | Description |
|---|---|---|
creation_date_time | string (date-time) | The date and time when the directory was created. |
directory_arn | string | The Amazon Resource Name (ARN) that is associated with the directory. For more information, see arns. |
name | string | The name of the directory. (pattern: <code>^[a-zA-Z0-9._-]*$</code>) |
state | string | The state of the directory. Can be either Enabled, Disabled, or Deleted. (ENABLED, DISABLED, DELETED) |
| Name | Datatype | Description |
|---|---|---|
creation_date_time | string (date-time) | The date and time when the directory was created. |
directory_arn | string | The Amazon Resource Name (ARN) that is associated with the directory. For more information, see arns. |
name | string | The name of the directory. (pattern: <code>^[a-zA-Z0-9._-]*$</code>) |
state | string | The state of the directory. Can be either Enabled, Disabled, or Deleted. (ENABLED, DISABLED, DELETED) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_directory | select | x-amz-data-partition, region | Retrieves metadata about a directory. | |
list_directories | select | region | Lists directories created within an account. | |
create_directory | insert | x-amz-data-partition, region | 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. | |
delete_directory | delete | x-amz-data-partition, region | Deletes a directory. Only disabled directories can be deleted. A deleted directory cannot be undone. Exercise extreme caution when deleting directories. | |
upgrade_applied_schema | exec | region, PublishedSchemaArn, DirectoryArn | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
x-amz-data-partition | string | The ARN of the directory to delete. |
SELECT examples
- get_directory
- list_directories
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
;
Lists directories created within an account.
SELECT
creation_date_time,
directory_arn,
name,
state
FROM aws.clouddirectory.directories
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_directory
- Manifest
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
;
# Description fields are for documentation purposes
- name: directories
props:
- name: x-amz-data-partition
value: "{{ x-amz-data-partition }}"
description: Required parameter for the directories resource.
- name: region
value: "{{ region }}"
description: Required parameter for the directories resource.
- name: Name
value: "{{ Name }}"
DELETE examples
- delete_directory
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
- upgrade_applied_schema
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 }}
}'
;