clusters
Creates, updates, deletes or gets a cluster
resource or lists clusters
in a region
Overview
Name | clusters |
Type | Resource |
Description | The AWS::DocDBElastic::Cluster Amazon DocumentDB (with MongoDB compatibility) Elastic Scale resource describes a Cluster |
Id | aws.docdbelastic.clusters |
Fields
Name | Datatype | Description |
---|---|---|
cluster_name | string | |
cluster_arn | string | |
cluster_endpoint | string | |
admin_user_name | string | |
admin_user_password | string | |
shard_capacity | integer | |
shard_count | integer | |
vpc_security_group_ids | array | |
subnet_ids | array | |
preferred_maintenance_window | string | |
preferred_backup_window | string | |
backup_retention_period | integer | |
shard_instance_count | integer | |
kms_key_id | string | |
tags | array | |
auth_type | string | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | ClusterName, AdminUserName, ShardCapacity, ShardCount, AuthType, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.docdbelastic.clusters (
ClusterName,
AdminUserName,
ShardCapacity,
ShardCount,
AuthType,
region
)
SELECT
'{{ ClusterName }}',
'{{ AdminUserName }}',
'{{ ShardCapacity }}',
'{{ ShardCount }}',
'{{ AuthType }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.docdbelastic.clusters (
ClusterName,
AdminUserName,
AdminUserPassword,
ShardCapacity,
ShardCount,
VpcSecurityGroupIds,
SubnetIds,
PreferredMaintenanceWindow,
PreferredBackupWindow,
BackupRetentionPeriod,
ShardInstanceCount,
KmsKeyId,
Tags,
AuthType,
region
)
SELECT
'{{ ClusterName }}',
'{{ AdminUserName }}',
'{{ AdminUserPassword }}',
'{{ ShardCapacity }}',
'{{ ShardCount }}',
'{{ VpcSecurityGroupIds }}',
'{{ SubnetIds }}',
'{{ PreferredMaintenanceWindow }}',
'{{ PreferredBackupWindow }}',
'{{ BackupRetentionPeriod }}',
'{{ ShardInstanceCount }}',
'{{ KmsKeyId }}',
'{{ Tags }}',
'{{ AuthType }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: cluster
props:
- name: ClusterName
value: '{{ ClusterName }}'
- name: AdminUserName
value: '{{ AdminUserName }}'
- name: AdminUserPassword
value: '{{ AdminUserPassword }}'
- name: ShardCapacity
value: '{{ ShardCapacity }}'
- name: ShardCount
value: '{{ ShardCount }}'
- name: VpcSecurityGroupIds
value:
- '{{ VpcSecurityGroupIds[0] }}'
- name: SubnetIds
value:
- '{{ SubnetIds[0] }}'
- name: PreferredMaintenanceWindow
value: '{{ PreferredMaintenanceWindow }}'
- name: PreferredBackupWindow
value: '{{ PreferredBackupWindow }}'
- name: BackupRetentionPeriod
value: '{{ BackupRetentionPeriod }}'
- name: ShardInstanceCount
value: '{{ ShardInstanceCount }}'
- name: KmsKeyId
value: '{{ KmsKeyId }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: AuthType
value: '{{ AuthType }}'
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