clusters
Creates, updates, deletes or gets a cluster resource or lists clusters in a region
Overview
| Name | clusters |
| Type | Resource |
| Description | The AWS::MemoryDB::Cluster resource creates an Amazon MemoryDB Cluster. |
| Id | awscc.memorydb.clusters |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
cluster_name | string | The name of the cluster. This value must be unique as it also serves as the cluster identifier. |
description | string | An optional description of the cluster. |
multi_region_cluster_name | string | The name of the Global Datastore, it is generated by MemoryDB adding a prefix to MultiRegionClusterNameSuffix. |
status | string | The status of the cluster. For example, Available, Updating, Creating. |
node_type | string | The compute and memory capacity of the nodes in the cluster. |
num_shards | integer | The number of shards the cluster will contain. |
num_replicas_per_shard | integer | The number of replicas to apply to each shard. The limit is 5. |
subnet_group_name | string | The name of the subnet group to be used for the cluster. |
security_group_ids | array | One or more Amazon VPC security groups associated with this cluster. |
maintenance_window | string | Specifies the weekly time range during which maintenance on the cluster is performed. It is specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute period. |
parameter_group_name | string | The name of the parameter group associated with the cluster. |
parameter_group_status | string | The status of the parameter group used by the cluster. |
port | integer | The port number on which each member of the cluster accepts connections. |
snapshot_retention_limit | integer | The number of days for which MemoryDB retains automatic snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, a snapshot that was taken today is retained for 5 days before being deleted. |
snapshot_window | string | The daily time range (in UTC) during which MemoryDB begins taking a daily snapshot of your cluster. |
acl_name | string | The name of the Access Control List to associate with the cluster. |
sns_topic_arn | string | The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic to which notifications are sent. |
sns_topic_status | string | The status of the Amazon SNS notification topic. Notifications are sent only if the status is enabled. |
tls_enabled | boolean | A flag that enables in-transit encryption when set to true.<br />You cannot modify the value of TransitEncryptionEnabled after the cluster is created. To enable in-transit encryption on a cluster you must set TransitEncryptionEnabled to true when you create a cluster. |
data_tiering | object | Enables data tiering. Data tiering is only supported for clusters using the r6gd node type. This parameter must be set when using r6gd nodes. |
network_type | object | Must be either ipv4 | ipv6 | dual_stack. |
ip_discovery | object | For clusters wth dual stack NetworkType, IpDiscovery controls the Ip protocol (ipv4 or ipv6) returned by the engine commands such as `cluster info` and `cluster nodes` which are used by clients to connect to the nodes in the cluster. |
kms_key_id | string | The ID of the KMS key used to encrypt the cluster. |
snapshot_arns | array | A list of Amazon Resource Names (ARN) that uniquely identify the RDB snapshot files stored in Amazon S3. The snapshot files are used to populate the new cluster. The Amazon S3 object name in the ARN cannot contain any commas. |
snapshot_name | string | The name of a snapshot from which to restore data into the new cluster. The snapshot status changes to restoring while the new cluster is being created. |
final_snapshot_name | string | The user-supplied name of a final cluster snapshot. This is the unique name that identifies the snapshot. MemoryDB creates the snapshot, and then deletes the cluster immediately afterward. |
arn | string | The Amazon Resource Name (ARN) of the cluster. |
engine | string | The engine type used by the cluster. |
engine_version | string | The Redis engine version used by the cluster. |
cluster_endpoint | object | The cluster endpoint. |
auto_minor_version_upgrade | boolean | A flag that enables automatic minor version upgrade when set to true.<br />You cannot modify the value of AutoMinorVersionUpgrade after the cluster is created. To enable AutoMinorVersionUpgrade on a cluster you must set AutoMinorVersionUpgrade to true when you create a cluster. |
tags | array | An array of key-value pairs to apply to this cluster. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
cluster_name | string | The name of the cluster. This value must be unique as it also serves as the cluster identifier. |
region | string | AWS region. |
For more information, see AWS::MemoryDB::Cluster.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | clusters | INSERT | ClusterName, NodeType, ACLName, region |
delete_resource | clusters | DELETE | Identifier, region |
update_resource | clusters | UPDATE | Identifier, PatchDocument, region |
list_resources | clusters_list_only | SELECT | region |
get_resource | clusters | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual cluster.
SELECT
region,
cluster_name,
description,
multi_region_cluster_name,
status,
node_type,
num_shards,
num_replicas_per_shard,
subnet_group_name,
security_group_ids,
maintenance_window,
parameter_group_name,
parameter_group_status,
port,
snapshot_retention_limit,
snapshot_window,
acl_name,
sns_topic_arn,
sns_topic_status,
tls_enabled,
data_tiering,
network_type,
ip_discovery,
kms_key_id,
snapshot_arns,
snapshot_name,
final_snapshot_name,
arn,
engine,
engine_version,
cluster_endpoint,
auto_minor_version_upgrade,
tags
FROM awscc.memorydb.clusters
WHERE
region = 'us-east-1' AND
Identifier = '{{ cluster_name }}';
Lists all clusters in a region.
SELECT
region,
cluster_name
FROM awscc.memorydb.clusters_list_only
WHERE
region = 'us-east-1';
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 awscc.memorydb.clusters (
ClusterName,
NodeType,
ACLName,
region
)
SELECT
'{{ cluster_name }}',
'{{ node_type }}',
'{{ acl_name }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.memorydb.clusters (
ClusterName,
Description,
MultiRegionClusterName,
NodeType,
NumShards,
NumReplicasPerShard,
SubnetGroupName,
SecurityGroupIds,
MaintenanceWindow,
ParameterGroupName,
Port,
SnapshotRetentionLimit,
SnapshotWindow,
ACLName,
SnsTopicArn,
SnsTopicStatus,
TLSEnabled,
DataTiering,
NetworkType,
IpDiscovery,
KmsKeyId,
SnapshotArns,
SnapshotName,
FinalSnapshotName,
Engine,
EngineVersion,
ClusterEndpoint,
AutoMinorVersionUpgrade,
Tags,
region
)
SELECT
'{{ cluster_name }}',
'{{ description }}',
'{{ multi_region_cluster_name }}',
'{{ node_type }}',
'{{ num_shards }}',
'{{ num_replicas_per_shard }}',
'{{ subnet_group_name }}',
'{{ security_group_ids }}',
'{{ maintenance_window }}',
'{{ parameter_group_name }}',
'{{ port }}',
'{{ snapshot_retention_limit }}',
'{{ snapshot_window }}',
'{{ acl_name }}',
'{{ sns_topic_arn }}',
'{{ sns_topic_status }}',
'{{ tls_enabled }}',
'{{ data_tiering }}',
'{{ network_type }}',
'{{ ip_discovery }}',
'{{ kms_key_id }}',
'{{ snapshot_arns }}',
'{{ snapshot_name }}',
'{{ final_snapshot_name }}',
'{{ engine }}',
'{{ engine_version }}',
'{{ cluster_endpoint }}',
'{{ auto_minor_version_upgrade }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: cluster
props:
- name: cluster_name
value: '{{ cluster_name }}'
- name: description
value: '{{ description }}'
- name: multi_region_cluster_name
value: '{{ multi_region_cluster_name }}'
- name: node_type
value: '{{ node_type }}'
- name: num_shards
value: '{{ num_shards }}'
- name: num_replicas_per_shard
value: '{{ num_replicas_per_shard }}'
- name: subnet_group_name
value: '{{ subnet_group_name }}'
- name: security_group_ids
value:
- '{{ security_group_ids[0] }}'
- name: maintenance_window
value: '{{ maintenance_window }}'
- name: parameter_group_name
value: '{{ parameter_group_name }}'
- name: port
value: '{{ port }}'
- name: snapshot_retention_limit
value: '{{ snapshot_retention_limit }}'
- name: snapshot_window
value: '{{ snapshot_window }}'
- name: acl_name
value: '{{ acl_name }}'
- name: sns_topic_arn
value: '{{ sns_topic_arn }}'
- name: sns_topic_status
value: '{{ sns_topic_status }}'
- name: tls_enabled
value: '{{ tls_enabled }}'
- name: data_tiering
value: '{{ data_tiering }}'
- name: network_type
value: '{{ network_type }}'
- name: ip_discovery
value: '{{ ip_discovery }}'
- name: kms_key_id
value: '{{ kms_key_id }}'
- name: snapshot_arns
value:
- '{{ snapshot_arns[0] }}'
- name: snapshot_name
value: '{{ snapshot_name }}'
- name: final_snapshot_name
value: '{{ final_snapshot_name }}'
- name: engine
value: '{{ engine }}'
- name: engine_version
value: '{{ engine_version }}'
- name: cluster_endpoint
value:
address: '{{ address }}'
port: '{{ port }}'
- name: auto_minor_version_upgrade
value: '{{ auto_minor_version_upgrade }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
UPDATE example
Use the following StackQL query and manifest file to update a cluster resource, using stack-deploy.
/*+ update */
UPDATE awscc.memorydb.clusters
SET PatchDocument = string('{{ {
"Description": description,
"NodeType": node_type,
"NumShards": num_shards,
"NumReplicasPerShard": num_replicas_per_shard,
"SecurityGroupIds": security_group_ids,
"MaintenanceWindow": maintenance_window,
"ParameterGroupName": parameter_group_name,
"SnapshotRetentionLimit": snapshot_retention_limit,
"SnapshotWindow": snapshot_window,
"ACLName": acl_name,
"SnsTopicArn": sns_topic_arn,
"SnsTopicStatus": sns_topic_status,
"IpDiscovery": ip_discovery,
"FinalSnapshotName": final_snapshot_name,
"Engine": engine,
"EngineVersion": engine_version,
"AutoMinorVersionUpgrade": auto_minor_version_upgrade,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ cluster_name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.memorydb.clusters
WHERE
Identifier = '{{ cluster_name }}' AND
region = 'us-east-1';
Permissions
To operate on the clusters resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
kms:DescribeKey,
kms:CreateGrant,
memorydb:CreateCluster,
memorydb:DescribeClusters,
memorydb:TagResource,
memorydb:ListTags,
iam:CreateServiceLinkedRole
memorydb:DescribeClusters,
memorydb:ListTags
memorydb:UpdateCluster,
memorydb:DescribeClusters,
memorydb:ListTags,
memorydb:TagResource,
memorydb:UntagResource
memorydb:DeleteCluster,
memorydb:DescribeClusters
memorydb:DescribeClusters