aws_memory_db
- Components
- Code examples
Manage Memory DB
--- installs the memory db module
SELECT * FROM iasql_install('<modules>');
--- creates a subnet group
INSERT INTO subnet_group (subnet_group_name)
VALUES ('<subnetGroupName>');
--- checks the subnet group was added
SELECT *
FROM subnet_group
WHERE subnet_group_name = '<subnetGroupName>';
--- changes the subnet group description
UPDATE subnet_group
SET description = 'Short desc'
WHERE subnet_group_name = '<subnetGroupName>';
--- creates a memory db cluster
INSERT INTO memory_db_cluster (cluster_name, subnet_group_id)
VALUES ('<clusterName>', (select id from subnet_group where subnet_group_name = '<subnetGroupName>'));
INSERT INTO memory_db_cluster_security_groups (security_group_id, memory_db_cluster_id, region)
VALUES ((select id from security_group where group_name = 'default' and region = '<region>'), (select id from memory_db_cluster where cluster_name = '<clusterName>'), '<region>');
--- checks the memory db cluster was added
SELECT *
FROM memory_db_cluster
WHERE cluster_name = '<clusterName>';
--- changes the cluster description
UPDATE memory_db_cluster
SET description = 'Short desc'
WHERE cluster_name = '<clusterName>';
--- removes the memory db cluster
DELETE FROM memory_db_cluster
WHERE cluster_name = '<clusterName>';
--- removes the subnet group
DELETE FROM subnet_group
WHERE subnet_group_name = '<subnetGroupName>';