OpenMCF logoOpenMCF

Loading...

AWS MemoryDB Cluster

Deploys an Amazon MemoryDB cluster — a fully managed, Redis-compatible, durable in-memory database with microsecond reads, single-digit millisecond writes, and Multi-AZ durability via a distributed transaction log. The component provisions the cluster with optional subnet group and parameter group management, ACL-based authentication, and always-on encryption at rest.

What Gets Created

When you deploy an AwsMemorydbCluster resource, OpenMCF provisions:

  • MemoryDB Cluster — a memorydb.Cluster resource with configurable shards and replicas per shard, TLS encryption, ACL-based authentication, and optional data tiering for cost-efficient large datasets
  • Subnet Group — created only when subnetIds are provided, placing cluster nodes in the specified VPC subnets
  • Parameter Group — created only when parameters are provided with a parameterGroupFamily, enabling custom engine tuning (e.g., activedefrag, maxmemory-policy)

Prerequisites

  • AWS credentials configured via environment variables or OpenMCF provider config
  • VPC subnets in at least two Availability Zones for production deployments
  • A security group allowing inbound traffic on port 6379 (default) from your application instances
  • A MemoryDB ACL — use the built-in open-access for development; create a custom ACL with users via AWS console/CLI for production authentication

Quick Start

Create a file memorydb.yaml:

apiVersion: aws.openmcf.org/v1
kind: AwsMemorydbCluster
metadata:
  name: my-memorydb
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.AwsMemorydbCluster.my-memorydb
spec:
  region: us-east-1
  engine: redis
  engineVersion: "7.1"
  nodeType: db.t4g.small
  numShards: 1
  numReplicasPerShard: 0
  aclName: open-access
  tlsEnabled: true

Deploy:

openmcf apply -f memorydb.yaml

This creates a single-shard, single-node MemoryDB cluster with Redis 7.1, TLS encryption, and no authentication.

Configuration Reference

Required Fields

FieldTypeDescriptionValidation
regionstringAWS region where the MemoryDB cluster will be created (e.g., us-west-2, eu-west-1).Required; non-empty
enginestringCache engine: "redis" or "valkey"Must be redis or valkey
nodeTypestringInstance type determining CPU, memory, and network capacity (e.g., "db.t4g.small", "db.r7g.large", "db.r6gd.xlarge" for data tiering)Required, non-empty

Optional Fields

FieldTypeDefaultDescription
engineVersionstringProvider defaultEngine version (e.g., "7.1", "7.0", "6.2")
descriptionstring—Human-readable cluster description
portint326379Connection port. ForceNew. Range: 1–65535.
numShardsint321Number of shards (data partitions). Min: 1.
numReplicasPerShardint321Replicas per shard. Range: 0–5.
aclNamestring"open-access"MemoryDB ACL name. Must be "open-access" when tlsEnabled is false.
subnetIdsStringValueOrRef[][]VPC subnet IDs for subnet group creation. Can reference AwsVpc via valueFrom.
securityGroupIdsStringValueOrRef[][]Security groups to attach. Can reference AwsSecurityGroup via valueFrom.
tlsEnabledbooltrueEnable TLS for in-transit encryption. ForceNew.
kmsKeyIdStringValueOrRef—Customer-managed KMS key ARN for at-rest encryption. ForceNew. Can reference AwsKmsKey.
maintenanceWindowstringAWS-assignedWeekly window in UTC: "ddd:hh24:mi-ddd:hh24:mi".
snapshotRetentionLimitint320Days to retain automatic snapshots (0–35). 0 disables.
snapshotWindowstringAWS-assignedDaily snapshot window in UTC: "hh24:mi-hh24:mi".
finalSnapshotNamestring—Final snapshot name on cluster deletion.
snapshotArnsstring[][]S3 ARNs of RDB files to restore from. ForceNew. Mutually exclusive with snapshotName.
snapshotNamestring—Named snapshot to restore from. ForceNew. Mutually exclusive with snapshotArns.
parameterGroupFamilystring—Required when parameters are provided (e.g., "memorydb_redis7").
parametersAwsMemorydbClusterParameter[][]Name/value pairs for engine parameter tuning.
snsTopicArnStringValueOrRef—SNS topic for cluster event notifications. Can reference AwsSnsTopic.
autoMinorVersionUpgradebooltrueAutomatically apply minor engine version upgrades.
dataTieringboolfalseMove cold data to SSD. Only available on db.r6gd.* node types. ForceNew.

Examples

Development Cluster

A minimal single-node cluster for local development:

apiVersion: aws.openmcf.org/v1
kind: AwsMemorydbCluster
metadata:
  name: dev-memorydb
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.AwsMemorydbCluster.dev-memorydb
spec:
  region: us-east-1
  engine: redis
  engineVersion: "7.1"
  nodeType: db.t4g.small
  numShards: 1
  numReplicasPerShard: 0
  aclName: open-access

Production HA with VPC and Snapshots

Multi-shard cluster with replicas, custom ACL, VPC placement, and daily snapshots:

apiVersion: aws.openmcf.org/v1
kind: AwsMemorydbCluster
metadata:
  name: session-store
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.AwsMemorydbCluster.session-store
spec:
  region: us-east-1
  engine: redis
  engineVersion: "7.1"
  description: Production session store
  nodeType: db.r7g.large
  numShards: 2
  numReplicasPerShard: 2
  aclName: prod-acl
  subnetIds:
    - subnet-0a1b2c3d4e5f00001
    - subnet-0a1b2c3d4e5f00002
  securityGroupIds:
    - sg-0123456789abcdef0
  snapshotRetentionLimit: 7
  snapshotWindow: "03:00-04:00"
  maintenanceWindow: "sun:05:00-sun:06:00"
  parameterGroupFamily: memorydb_redis7
  parameters:
    - name: activedefrag
      value: "yes"

Full-Featured with Foreign Key References

Production cluster using cross-resource references for VPC, security group, KMS, and SNS:

apiVersion: aws.openmcf.org/v1
kind: AwsMemorydbCluster
metadata:
  name: analytics-store
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.AwsMemorydbCluster.analytics-store
spec:
  region: us-east-1
  engine: redis
  engineVersion: "7.1"
  description: High-throughput analytics store
  nodeType: db.r6gd.xlarge
  numShards: 4
  numReplicasPerShard: 2
  aclName: analytics-acl
  dataTiering: true
  subnetIds:
    - valueFrom:
        kind: AwsVpc
        name: main-vpc
        fieldPath: status.outputs.private_subnets.[0].id
    - valueFrom:
        kind: AwsVpc
        name: main-vpc
        fieldPath: status.outputs.private_subnets.[1].id
  securityGroupIds:
    - valueFrom:
        kind: AwsSecurityGroup
        name: memorydb-sg
        fieldPath: status.outputs.security_group_id
  kmsKeyId:
    valueFrom:
      kind: AwsKmsKey
      name: memorydb-key
      fieldPath: status.outputs.key_arn
  snapshotRetentionLimit: 14
  snapshotWindow: "02:00-03:00"
  maintenanceWindow: "wed:04:00-wed:05:00"
  parameterGroupFamily: memorydb_redis7
  parameters:
    - name: activedefrag
      value: "yes"
    - name: maxmemory-policy
      value: volatile-lru
  snsTopicArn:
    valueFrom:
      kind: AwsSnsTopic
      name: infra-alerts
      fieldPath: status.outputs.topic_arn

Stack Outputs

After deployment, the following outputs are available in status.outputs:

OutputTypeDescription
cluster_endpoint_addressstringDNS address of the cluster endpoint for client connections
cluster_endpoint_portint32Port of the cluster endpoint
cluster_arnstringARN of the MemoryDB cluster
cluster_namestringName of the cluster (matches metadata.id)
engine_patch_versionstringActual engine patch version running on the cluster
subnet_group_namestringName of the created subnet group (empty if not created)
parameter_group_namestringName of the created parameter group (empty if not created)

Related Components

  • AwsVpc — provides VPC subnets for cluster placement
  • AwsSecurityGroup — controls network access to MemoryDB endpoints
  • AwsKmsKey — provides a customer-managed key for at-rest encryption
  • AwsSnsTopic — receives cluster event notifications
  • AwsRedisElasticache — ephemeral caching alternative when durability is not needed

Next article

AWS MSK Cluster

AWS MSK Cluster Deploys an Amazon MSK (Managed Streaming for Apache Kafka) cluster with configurable broker nodes, multi-method authentication (SASL/IAM, SASL/SCRAM, mTLS), encryption at rest and in transit, inline Kafka configuration management, and broker log delivery to CloudWatch Logs, Kinesis Data Firehose, and S3. The component creates a managed security group with Kafka and ZooKeeper port rules when ingress sources are specified. What Gets Created When you deploy an AwsMskCluster...
Read next article
Presets
3 ready-to-deploy configurationsView presets →