Skip to main content

clusters

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

Overview

Nameclusters
TypeResource
Idaws.docdb_elastic.clusters

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
admin_user_namestringThe name of the elastic cluster administrator.
auth_typestringThe authentication type for the elastic cluster. (PLAIN_TEXT, SECRET_ARN)
backup_retention_periodintegerThe number of days for which automatic snapshots are retained.
cluster_arnstringThe ARN identifier of the elastic cluster.
cluster_endpointstringThe URL used to connect to the elastic cluster.
cluster_namestringThe name of the elastic cluster.
create_timestringThe time when the elastic cluster was created in Universal Coordinated Time (UTC).
kms_key_idstringThe KMS key identifier to use to encrypt the elastic cluster.
preferred_backup_windowstringThe daily time range during which automated backups are created if automated backups are enabled, as determined by backupRetentionPeriod.
preferred_maintenance_windowstringThe weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). Format: ddd:hh24:mi-ddd:hh24:mi
shard_capacityintegerThe number of vCPUs assigned to each elastic cluster shard. Maximum is 64. Allowed values are 2, 4, 8, 16, 32, 64.
shard_countintegerThe number of shards assigned to the elastic cluster. Maximum is 32.
shard_instance_countintegerThe number of replica instances applying to all shards in the cluster. A shardInstanceCount value of 1 means there is one writer instance, and any additional instances are replicas that can be used for reads and to improve availability.
shardsarrayThe total number of shards in the cluster.
statusstringThe status of the elastic cluster. (CREATING, ACTIVE, DELETING, UPDATING, VPC_ENDPOINT_LIMIT_EXCEEDED, IP_ADDRESS_LIMIT_EXCEEDED, INVALID_SECURITY_GROUP_ID, INVALID_SUBNET_ID, INACCESSIBLE_ENCRYPTION_CREDS, INACCESSIBLE_SECRET_ARN, INACCESSIBLE_VPC_ENDPOINT, INCOMPATIBLE_NETWORK, MERGING, MODIFYING, SPLITTING, COPYING, STARTING, STOPPING, STOPPED, MAINTENANCE, INACCESSIBLE_ENCRYPTION_CREDENTIALS_RECOVERABLE)
subnet_idsarrayThe Amazon EC2 subnet IDs for the elastic cluster.
vpc_security_group_idsarrayA list of EC2 VPC security groups associated with thie elastic cluster.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_clusterselectcluster_arn, regionReturns information about a specific elastic cluster.
list_clustersselectregionmaxResults, nextTokenReturns information about provisioned Amazon DocumentDB elastic clusters.
create_clusterinsertregion, adminUserName, adminUserPassword, authType, clusterName, shardCapacity, shardCountCreates a new Amazon DocumentDB elastic cluster and returns its cluster structure.
update_clusterupdatecluster_arn, regionModifies an elastic cluster. This includes updating admin-username/password, upgrading the API version, and setting up a backup window and maintenance window
delete_clusterdeletecluster_arn, regionDelete an elastic cluster.
copy_cluster_snapshotexecsnapshot_arn, region, targetSnapshotNameCopies a snapshot of an elastic cluster.
restore_cluster_from_snapshotexecsnapshot_arn, region, clusterNameRestores an elastic cluster from a snapshot.
start_clusterexeccluster_arn, regionRestarts the stopped elastic cluster that is specified by clusterARN.
stop_clusterexeccluster_arn, regionStops the running elastic cluster that is specified by clusterArn. The elastic cluster must be in the available state.

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
cluster_arnstringThe ARN identifier of the elastic cluster.
regionstringAWS region (default: us-east-1)
snapshot_arnstringThe ARN identifier of the elastic cluster snapshot.
maxResultsintegerThe maximum number of elastic cluster snapshot results to receive in the response.
nextTokenstringA pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond this token, up to the value specified by max-results. If there is no more data in the responce, the nextToken will not be returned.

SELECT examples

Returns information about a specific elastic cluster.

SELECT
admin_user_name,
auth_type,
backup_retention_period,
cluster_arn,
cluster_endpoint,
cluster_name,
create_time,
kms_key_id,
preferred_backup_window,
preferred_maintenance_window,
shard_capacity,
shard_count,
shard_instance_count,
shards,
status,
subnet_ids,
vpc_security_group_ids
FROM aws.docdb_elastic.clusters
WHERE cluster_arn = '{{ cluster_arn }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new Amazon DocumentDB elastic cluster and returns its cluster structure.

INSERT INTO aws.docdb_elastic.clusters (
adminUserName,
adminUserPassword,
authType,
backupRetentionPeriod,
clientToken,
clusterName,
kmsKeyId,
preferredBackupWindow,
preferredMaintenanceWindow,
shardCapacity,
shardCount,
shardInstanceCount,
subnetIds,
tags,
vpcSecurityGroupIds,
region
)
SELECT
'{{ adminUserName }}' /* required */,
'{{ adminUserPassword }}' /* required */,
'{{ authType }}' /* required */,
{{ backupRetentionPeriod }},
'{{ clientToken }}',
'{{ clusterName }}' /* required */,
'{{ kmsKeyId }}',
'{{ preferredBackupWindow }}',
'{{ preferredMaintenanceWindow }}',
{{ shardCapacity }} /* required */,
{{ shardCount }} /* required */,
{{ shardInstanceCount }},
'{{ subnetIds }}',
'{{ tags }}',
'{{ vpcSecurityGroupIds }}',
'{{ region }}'
RETURNING
cluster
;

UPDATE examples

Modifies an elastic cluster. This includes updating admin-username/password, upgrading the API version, and setting up a backup window and maintenance window

UPDATE aws.docdb_elastic.clusters
SET
adminUserPassword = '{{ adminUserPassword }}',
authType = '{{ authType }}',
backupRetentionPeriod = {{ backupRetentionPeriod }},
clientToken = '{{ clientToken }}',
preferredBackupWindow = '{{ preferredBackupWindow }}',
preferredMaintenanceWindow = '{{ preferredMaintenanceWindow }}',
shardCapacity = {{ shardCapacity }},
shardCount = {{ shardCount }},
shardInstanceCount = {{ shardInstanceCount }},
subnetIds = '{{ subnetIds }}',
vpcSecurityGroupIds = '{{ vpcSecurityGroupIds }}'
WHERE
cluster_arn = '{{ cluster_arn }}' --required
AND region = '{{ region }}' --required
RETURNING
cluster;

DELETE examples

Delete an elastic cluster.

DELETE FROM aws.docdb_elastic.clusters
WHERE cluster_arn = '{{ cluster_arn }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Copies a snapshot of an elastic cluster.

EXEC aws.docdb_elastic.clusters.copy_cluster_snapshot
@snapshot_arn='{{ snapshot_arn }}' --required,
@region='{{ region }}' --required
@@json=
'{
"copyTags": {{ copyTags }},
"kmsKeyId": "{{ kmsKeyId }}",
"tags": "{{ tags }}",
"targetSnapshotName": "{{ targetSnapshotName }}"
}'
;