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
Idawscc.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.

For more information, see AWS::DocDBElastic::Cluster.

Methods

NameResourceAccessible byRequired Params
create_resourceclustersINSERTClusterName, AdminUserName, ShardCapacity, ShardCount, AuthType, region
delete_resourceclustersDELETEIdentifier, region
update_resourceclustersUPDATEIdentifier, PatchDocument, region
list_resourcesclusters_list_onlySELECTregion
get_resourceclustersSELECTIdentifier, region

SELECT examples

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 awscc.docdbelastic.clusters
WHERE
region = 'us-east-1' AND
Identifier = '{{ cluster_arn }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.docdbelastic.clusters (
ClusterName,
AdminUserName,
ShardCapacity,
ShardCount,
AuthType,
region
)
SELECT
'{{ cluster_name }}',
'{{ admin_user_name }}',
'{{ shard_capacity }}',
'{{ shard_count }}',
'{{ auth_type }}',
'{{ region }}';

UPDATE example

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

/*+ update */
UPDATE awscc.docdbelastic.clusters
SET PatchDocument = string('{{ {
"AdminUserPassword": admin_user_password,
"ShardCapacity": shard_capacity,
"ShardCount": shard_count,
"VpcSecurityGroupIds": vpc_security_group_ids,
"SubnetIds": subnet_ids,
"PreferredMaintenanceWindow": preferred_maintenance_window,
"PreferredBackupWindow": preferred_backup_window,
"BackupRetentionPeriod": backup_retention_period,
"ShardInstanceCount": shard_instance_count,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ cluster_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.docdbelastic.clusters
WHERE
Identifier = '{{ cluster_arn }}' AND
region = 'us-east-1';

Permissions

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

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