Skip to main content

clusters

Creates, updates, deletes or gets a cluster resource or lists clusters in a region

Overview

Nameclusters
TypeResource
DescriptionThe AWS::DocDBElastic::Cluster Amazon DocumentDB (with MongoDB compatibility) Elastic Scale resource describes a Cluster
Idaws.docdbelastic.clusters

Fields

NameDatatypeDescription
cluster_namestring
cluster_arnstring
cluster_endpointstring
admin_user_namestring
admin_user_passwordstring
shard_capacityinteger
shard_countinteger
vpc_security_group_idsarray
subnet_idsarray
preferred_maintenance_windowstring
preferred_backup_windowstring
backup_retention_periodinteger
shard_instance_countinteger
kms_key_idstring
tagsarray
auth_typestring
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTClusterName, AdminUserName, ShardCapacity, ShardCount, AuthType, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all clusters in a region.

SELECT
region,
cluster_name,
cluster_arn,
cluster_endpoint,
admin_user_name,
admin_user_password,
shard_capacity,
shard_count,
vpc_security_group_ids,
subnet_ids,
preferred_maintenance_window,
preferred_backup_window,
backup_retention_period,
shard_instance_count,
kms_key_id,
tags,
auth_type
FROM aws.docdbelastic.clusters
WHERE region = 'us-east-1';

Gets all properties from an individual cluster.

SELECT
region,
cluster_name,
cluster_arn,
cluster_endpoint,
admin_user_name,
admin_user_password,
shard_capacity,
shard_count,
vpc_security_group_ids,
subnet_ids,
preferred_maintenance_window,
preferred_backup_window,
backup_retention_period,
shard_instance_count,
kms_key_id,
tags,
auth_type
FROM aws.docdbelastic.clusters
WHERE region = 'us-east-1' AND data__Identifier = '<ClusterArn>';

INSERT example

Use the following StackQL query and manifest file to create a new cluster resource, using stack-deploy.

/*+ create */
INSERT INTO aws.docdbelastic.clusters (
ClusterName,
AdminUserName,
ShardCapacity,
ShardCount,
AuthType,
region
)
SELECT
'{{ ClusterName }}',
'{{ AdminUserName }}',
'{{ ShardCapacity }}',
'{{ ShardCount }}',
'{{ AuthType }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.docdbelastic.clusters
WHERE data__Identifier = '<ClusterArn>'
AND region = 'us-east-1';

Permissions

To operate on the clusters resource, the following permissions are required:

Create

docdb-elastic:CreateCluster,
docdb-elastic:TagResource,
docdb-elastic:GetCluster,
docdb-elastic:ListTagsForResource,
ec2:CreateVpcEndpoint,
ec2:DescribeVpcEndpoints,
ec2:DeleteVpcEndpoints,
ec2:ModifyVpcEndpoint,
ec2:DescribeSecurityGroups,
ec2:DescribeSubnets,
ec2:DescribeVpcAttribute,
ec2:DescribeVpcs,
ec2:DescribeAvailabilityZones,
secretsmanager:ListSecrets,
secretsmanager:ListSecretVersionIds,
secretsmanager:DescribeSecret,
secretsmanager:GetSecretValue,
secretsmanager:GetResourcePolicy,
kms:DescribeKey,
kms:CreateGrant,
kms:GenerateDataKey,
kms:Decrypt,
iam:CreateServiceLinkedRole

Read

docdb-elastic:GetCluster,
docdb-elastic:ListTagsForResource

Update

docdb-elastic:UpdateCluster,
docdb-elastic:TagResource,
docdb-elastic:UntagResource,
docdb-elastic:GetCluster,
docdb-elastic:ListTagsForResource,
ec2:CreateVpcEndpoint,
ec2:DescribeVpcEndpoints,
ec2:DeleteVpcEndpoints,
ec2:ModifyVpcEndpoint,
ec2:DescribeSecurityGroups,
ec2:DescribeSubnets,
ec2:DescribeVpcAttribute,
ec2:DescribeVpcs,
ec2:DescribeAvailabilityZones,
secretsmanager:ListSecrets,
secretsmanager:ListSecretVersionIds,
secretsmanager:DescribeSecret,
secretsmanager:GetSecretValue,
secretsmanager:GetResourcePolicy,
kms:DescribeKey,
kms:CreateGrant,
kms:GenerateDataKey,
kms:Decrypt

Delete

docdb-elastic:DeleteCluster,
docdb-elastic:GetCluster,
ec2:DescribeVpcEndpoints,
ec2:DeleteVpcEndpoints,
ec2:ModifyVpcEndpoint,
ec2:DescribeSecurityGroups,
ec2:DescribeSubnets,
ec2:DescribeVpcAttribute,
ec2:DescribeVpcs,
ec2:DescribeAvailabilityZones

List

docdb-elastic:ListClusters