AWS.MemoryDB reference
Source:
src/AWS/MemoryDB/ACL.ts
A MemoryDB Access Control List (ACL) — a named collection of Users
that a cluster authenticates against. Attach an ACL to a
Cluster via aclName.
ACLs are free and provision quickly.
ACL: Creating an ACL
Section titled “ACL: Creating an ACL”const appUser = yield* User("AppUser", { authenticationMode: { type: "password", passwords: [appPassword] }, accessString: "on ~* +@all",});const acl = yield* ACL("AppAcl", { userNames: [appUser.userName],});BatchUpdateCluster
Section titled “BatchUpdateCluster”Source:
src/AWS/MemoryDB/BatchUpdateCluster.ts
Runtime binding for the BatchUpdateCluster operation (IAM action
memorydb:BatchUpdateCluster).
Applies a service update (security patch, engine upgrade) to a list of
clusters — pair with DescribeServiceUpdates to build patch
automation that applies available updates inside a maintenance window.
Clusters that cannot take the update are returned in
UnprocessedClusters (with the reason) rather than failing the call.
Provide the implementation with
Effect.provide(AWS.MemoryDB.BatchUpdateClusterHttp).
BatchUpdateCluster: Applying Service Updates
Section titled “BatchUpdateCluster: Applying Service Updates”const batchUpdateCluster = yield* MemoryDB.BatchUpdateCluster();
const result = yield* batchUpdateCluster({ ClusterNames: [clusterName], ServiceUpdate: { ServiceUpdateNameToApply: updateName },});// result.ProcessedClusters / result.UnprocessedClustersCluster
Section titled “Cluster”Source:
src/AWS/MemoryDB/Cluster.ts
An Amazon MemoryDB cluster — a durable, Redis/Valkey-compatible in-memory database.
Clusters take roughly 10-15 minutes to provision and are billed per node
while they exist. They are reachable only from inside a VPC and require an
ACL; place them in a SubnetGroup spanning multiple AZs for
high availability. Destroy clusters you are not using.
Cluster: Creating a Cluster
Section titled “Cluster: Creating a Cluster”const user = yield* User("CacheUser", { authenticationMode: { type: "password", passwords: [cachePassword] }, accessString: "on ~* +@all",});const acl = yield* ACL("CacheAcl", { userNames: [user.userName] });const subnetGroup = yield* SubnetGroup("CacheSubnets", { subnetIds: [subnetA.subnetId, subnetB.subnetId],});const cluster = yield* Cluster("Cache", { nodeType: "db.t4g.small", aclName: acl.aclName, subnetGroupName: subnetGroup.subnetGroupName, numShards: 1, numReplicasPerShard: 1,});Connect
Section titled “Connect”Source:
src/AWS/MemoryDB/Connect.ts
Runtime binding that resolves connection settings for a MemoryDB
Cluster.
At deploy time it publishes the cluster endpoint as
MEMORYDB_{LOGICAL_ID}_{HOST,PORT,TLS} environment variables on the host
Function and grants memorydb:Connect on the cluster (plus any IAM-auth
Users passed via options.users); at runtime it resolves the same
values into a typed ClusterConnectionInfo. Network access is
governed by VPC security groups — the host Function must:
- be attached to the cluster’s VPC (
vpc: { subnetIds, securityGroupIds }or the binding’ssubnetIds/securityGroupIdsoptions), and - have a security group allowed ingress on the cluster’s port by one of
the cluster’s
securityGroupIds.
Provide the implementation with Effect.provide(AWS.MemoryDB.ConnectHttp).
Connect: Connecting to a Cluster
Section titled “Connect: Connecting to a Cluster”// init — publishes env vars, grants memorydb:Connect, attaches the VPCconst connect = yield* AWS.MemoryDB.Connect(cluster, { users: [appUser], subnetIds: [subnetA.subnetId, subnetB.subnetId], securityGroupIds: [appSecurityGroup.groupId],});
// inside a handler:const { host, port, tls } = yield* connect;CopySnapshot
Section titled “CopySnapshot”Source:
src/AWS/MemoryDB/CopySnapshot.ts
Runtime binding for the CopySnapshot operation (IAM actions
memorydb:CopySnapshot + memorydb:TagResource on the snapshot ARN
wildcard — snapshot names are runtime data).
Makes a copy of an existing snapshot, optionally exporting it to an S3
bucket via TargetBucket. Provide the implementation with
Effect.provide(AWS.MemoryDB.CopySnapshotHttp).
CopySnapshot: Managing Snapshots
Section titled “CopySnapshot: Managing Snapshots”const copySnapshot = yield* MemoryDB.CopySnapshot();
const result = yield* copySnapshot({ SourceSnapshotName: "pre-migration", TargetSnapshotName: "pre-migration-archive",});// result.Snapshot.Status → "creating"CreateSnapshot
Section titled “CreateSnapshot”Source:
src/AWS/MemoryDB/CreateSnapshot.ts
Runtime binding for the CreateSnapshot operation (IAM actions
memorydb:CreateSnapshot + memorydb:TagResource), scoped to one
Cluster.
Takes an on-demand snapshot of the bound cluster — e.g. a pre-migration
backup from an operational Lambda. Provide the implementation with
Effect.provide(AWS.MemoryDB.CreateSnapshotHttp).
CreateSnapshot: Managing Snapshots
Section titled “CreateSnapshot: Managing Snapshots”const createSnapshot = yield* MemoryDB.CreateSnapshot(cluster);
const result = yield* createSnapshot({ SnapshotName: "pre-migration" });// result.Snapshot.Status → "creating"DeleteSnapshot
Section titled “DeleteSnapshot”Source:
src/AWS/MemoryDB/DeleteSnapshot.ts
Runtime binding for the DeleteSnapshot operation (IAM action
memorydb:DeleteSnapshot on the snapshot ARN wildcard — snapshot names
are runtime data).
Deletes a snapshot by name — e.g. pruning old on-demand backups from a
scheduled cleanup Lambda. Provide the implementation with
Effect.provide(AWS.MemoryDB.DeleteSnapshotHttp).
DeleteSnapshot: Managing Snapshots
Section titled “DeleteSnapshot: Managing Snapshots”const deleteSnapshot = yield* MemoryDB.DeleteSnapshot();
yield* deleteSnapshot({ SnapshotName: "pre-migration" }).pipe( Effect.catchTag("SnapshotNotFoundFault", () => Effect.void),);DescribeClusters
Section titled “DescribeClusters”Source:
src/AWS/MemoryDB/DescribeClusters.ts
Runtime binding for the DescribeClusters operation (IAM action
memorydb:DescribeClusters).
Lists the account’s MemoryDB clusters, or describes a single cluster by
name — e.g. checking a cluster’s status or endpoint from an operational
Lambda. Provide the implementation with
Effect.provide(AWS.MemoryDB.DescribeClustersHttp).
DescribeClusters: Monitoring Clusters
Section titled “DescribeClusters: Monitoring Clusters”const describeClusters = yield* MemoryDB.DescribeClusters();
const page = yield* describeClusters({ ClusterName: clusterName });// page.Clusters[0].Status → "available"DescribeEngineVersions
Section titled “DescribeEngineVersions”Source:
src/AWS/MemoryDB/DescribeEngineVersions.ts
Runtime binding for the DescribeEngineVersions operation (IAM action
memorydb:DescribeEngineVersions).
Lists the engine versions MemoryDB supports (redis/valkey) and their
parameter group families — e.g. upgrade automation that checks whether a
newer engine version is available before scheduling a cluster update.
Provide the implementation with
Effect.provide(AWS.MemoryDB.DescribeEngineVersionsHttp).
DescribeEngineVersions: Applying Service Updates
Section titled “DescribeEngineVersions: Applying Service Updates”const describeEngineVersions = yield* MemoryDB.DescribeEngineVersions();
const page = yield* describeEngineVersions({ Engine: "valkey" });// page.EngineVersions[0].EngineVersionDescribeEvents
Section titled “DescribeEvents”Source:
src/AWS/MemoryDB/DescribeEvents.ts
Runtime binding for the DescribeEvents operation (IAM action
memorydb:DescribeEvents).
Returns events related to clusters, security groups, and parameter groups
from the last hour (up to 14 days with an explicit time window) — snapshot
completions, failovers, configuration changes. Provide the implementation
with Effect.provide(AWS.MemoryDB.DescribeEventsHttp).
DescribeEvents: Monitoring Clusters
Section titled “DescribeEvents: Monitoring Clusters”const describeEvents = yield* MemoryDB.DescribeEvents();
const page = yield* describeEvents({ SourceName: clusterName, SourceType: "cluster",});for (const event of page.Events ?? []) { yield* Effect.logInfo(`${event.Date}: ${event.Message}`);}DescribeServiceUpdates
Section titled “DescribeServiceUpdates”Source:
src/AWS/MemoryDB/DescribeServiceUpdates.ts
Runtime binding for the DescribeServiceUpdates operation (IAM action
memorydb:DescribeServiceUpdates).
Lists the service updates (security patches, engine upgrades) available or
scheduled for the account’s clusters — pair with
BatchUpdateCluster to build patch automation. Provide the
implementation with
Effect.provide(AWS.MemoryDB.DescribeServiceUpdatesHttp).
DescribeServiceUpdates: Applying Service Updates
Section titled “DescribeServiceUpdates: Applying Service Updates”const describeServiceUpdates = yield* MemoryDB.DescribeServiceUpdates();
const page = yield* describeServiceUpdates({ Status: ["available"] });// page.ServiceUpdates[0].ServiceUpdateNameDescribeSnapshots
Section titled “DescribeSnapshots”Source:
src/AWS/MemoryDB/DescribeSnapshots.ts
Runtime binding for the DescribeSnapshots operation (IAM action
memorydb:DescribeSnapshots).
Lists the account’s cluster snapshots, optionally filtered by cluster or
snapshot name — e.g. verifying a backup completed before a migration.
Provide the implementation with
Effect.provide(AWS.MemoryDB.DescribeSnapshotsHttp).
DescribeSnapshots: Managing Snapshots
Section titled “DescribeSnapshots: Managing Snapshots”const describeSnapshots = yield* MemoryDB.DescribeSnapshots();
const page = yield* describeSnapshots({ ClusterName: clusterName });for (const snapshot of page.Snapshots ?? []) { yield* Effect.logInfo(`${snapshot.Name}: ${snapshot.Status}`);}FailoverShard
Section titled “FailoverShard”Source:
src/AWS/MemoryDB/FailoverShard.ts
Runtime binding for the FailoverShard operation (IAM action
memorydb:FailoverShard), scoped to one Cluster.
Fails over a shard’s primary node to a replica — designed for testing how
your application behaves during a MemoryDB failover (chaos testing), not
as a production remediation tool. Provide the implementation with
Effect.provide(AWS.MemoryDB.FailoverShardHttp).
FailoverShard: Testing Failover
Section titled “FailoverShard: Testing Failover”const failoverShard = yield* MemoryDB.FailoverShard(cluster);
const result = yield* failoverShard({ ShardName: "0001" });// result.Cluster.Status → "updating"ListAllowedNodeTypeUpdates
Section titled “ListAllowedNodeTypeUpdates”Source:
src/AWS/MemoryDB/ListAllowedNodeTypeUpdates.ts
Runtime binding for the ListAllowedNodeTypeUpdates operation (IAM action
memorydb:ListAllowedNodeTypeUpdates), scoped to one Cluster.
Lists the node types the bound cluster can scale up or down to — e.g.
right-sizing automation that checks the legal targets before calling
UpdateCluster. Provide the implementation with
Effect.provide(AWS.MemoryDB.ListAllowedNodeTypeUpdatesHttp).
ListAllowedNodeTypeUpdates: Monitoring Clusters
Section titled “ListAllowedNodeTypeUpdates: Monitoring Clusters”const listAllowedNodeTypeUpdates = yield* MemoryDB.ListAllowedNodeTypeUpdates(cluster);
const result = yield* listAllowedNodeTypeUpdates();// result.ScaleUpNodeTypes / result.ScaleDownNodeTypesParameterGroup
Section titled “ParameterGroup”Source:
src/AWS/MemoryDB/ParameterGroup.ts
A MemoryDB parameter group — a named collection of engine parameter
overrides applied to every node of any Cluster that references it
via parameterGroupName.
Parameter groups are free and provision instantly. Parameters not listed
keep their engine defaults; removing a parameter from parameters resets
it to the default.
ParameterGroup: Creating a Parameter Group
Section titled “ParameterGroup: Creating a Parameter Group”const params = yield* ParameterGroup("CacheParams", { family: "memorydb_valkey7", description: "LRU eviction for the session cache", parameters: { "maxmemory-policy": "allkeys-lru" },});const cluster = yield* Cluster("Cache", { aclName: acl.aclName, parameterGroupName: params.parameterGroupName,});SubnetGroup
Section titled “SubnetGroup”Source:
src/AWS/MemoryDB/SubnetGroup.ts
A MemoryDB subnet group — the set of VPC subnets a MemoryDB cluster’s nodes are placed into.
Subnet groups are free and provision instantly. A cluster references one by
name via subnetGroupName.
SubnetGroup: Creating a Subnet Group
Section titled “SubnetGroup: Creating a Subnet Group”const subnetGroup = yield* SubnetGroup("CacheSubnets", { description: "MemoryDB cluster subnets", subnetIds: [subnetA.subnetId, subnetB.subnetId],});Source:
src/AWS/MemoryDB/User.ts
A MemoryDB user — an RBAC identity that authenticates to a cluster and is
granted permissions through an access string. Users are grouped into
ACLs, which are attached to clusters.
Users are free and provision quickly. Passwords are write-only.
User: Creating a User
Section titled “User: Creating a User”Password User with Full Access
const user = yield* User("AppUser", { authenticationMode: { type: "password", passwords: [appPassword] }, accessString: "on ~* +@all",});IAM-Authenticated User
const user = yield* User("IamUser", { userName: "iam-app-user", authenticationMode: { type: "iam" }, accessString: "on ~* +@all",});