add elasticache module#28
Merged
Merged
Conversation
Ravion Module Publish PlanDry run only. No Ravion API mutations were made.
Diffsrvn-elasticache n/a -> 0.1.0--- remote
+++ compiled
-
+description: Creates and manages Amazon ElastiCache for Redis, Valkey, Memcached, or serverless Redis-compatible caches.
+name: ElastiCache
+type: rvn-elasticachervn-elasticache n/a -> 0.1.0--- remote
+++ compiled
+inputs:
+ - id: network
+ immutable: true
+ label: VPC network
+ mapped_inputs:
+ - id: section_aws
+ label: AWS account & region
+ type: section
+ - default: << ref.input.aws_account_id >>
+ id: aws_account_id
+ immutable: true
+ label: AWS account
+ type: string
+ values: $values:ravion/aws_accounts
+ - default: << ref.input.aws_region >>
+ description: AWS region for this cache.
+ id: aws_region
+ immutable: true
+ label: Region
+ type: string
+ values: $values:aws/regions
+ - collapsible: true
+ default: << ref.input.execution_environment_id >>
+ description: Override the VPC, subnet, and security group for Terraform runners. Must use the same AWS account as selected above.
+ id: execution_environment_id
+ label: Terraform execution environment
+ type: string
+ values: $values:ravion/execution_environments
+ - id: section_vpc
+ label: VPC
+ type: section
+ - default: <<ref.stack.output.vpc_id>>
+ id: vpc_id
+ immutable: true
+ label: VPC ID
+ required: true
+ type: string
+ - add_button_label: Add private subnet ID
+ default: <<ref.stack.output.private_subnet_ids>>
+ description: Subnets for the ElastiCache subnet group or serverless cache. Use private subnets for normal cache deployments.
+ id: subnet_ids
+ immutable: true
+ label: Private subnet IDs
+ required: true
+ type: string_array
+ required: true
+ type: $ref:rvn-aws-network
+ - id: section_cache
+ label: Cache
+ type: section
+ - default: <<project.given_id>>-<<environment.given_id>>
+ description: Name prefix for all ElastiCache resources.
+ id: name
+ immutable: true
+ label: Name slug
+ patterns:
+ - message: 1-40 lowercase letters, numbers, and hyphens. Start and end with a letter or number.
+ pattern: ^[a-z0-9]([a-z0-9-]{0,38}[a-z0-9])?$
+ required: true
+ type: string
+ - id: section_version
+ label: Version
+ type: section
+ - default: valkey
+ description: Choose Valkey for Redis-compatible workloads with lower AWS pricing, Redis for Redis OSS compatibility requirements, or Memcached for simple non-persistent object caching without Redis data structures. AWS prices Valkey 20% lower than Redis OSS for node-based ElastiCache and 33% lower for Serverless, with a 90% lower Serverless minimum data storage size.
+ id: engine
+ immutable: true
+ label: Engine
+ required: true
+ type: string
+ values:
+ - description: Recommended default for Redis-compatible workloads. AWS prices Valkey 20% lower than Redis OSS for node-based caches and 33% lower for Serverless, with a 90% lower Serverless minimum data storage size.
+ label: Valkey
+ value: valkey
+ - description: Use when you specifically need Redis OSS engine compatibility or have an existing Redis OSS requirement.
+ label: Redis
+ value: redis
+ - description: Best for simple volatile object caching where you do not need Redis commands, persistence, replicas, or cluster-mode sharding.
+ label: Memcached
+ value: memcached
+ - description: Major engine version. Current latest major versions include Valkey 9, Redis OSS 7, and Memcached 1.6.
+ id: engine_major_version
+ immutable: true
+ label: Engine major version
+ placeholder: "9"
+ required: true
+ type: string
+ - description: Minor or patch version appended to the major version.
+ id: engine_minor_version
+ label: Engine minor version
+ placeholder: "0"
+ required: true
+ type: string
+ - default: true
+ description: Enable automatic minor engine version upgrades during the maintenance window.
+ id: minor_version_auto_upgrade_enabled
+ label: Auto minor version upgrades
+ show_when:
+ serverless_enabled: false
+ type: boolean
+ - id: section_size
+ label: Size & topology
+ type: section
+ - default: false
+ description: Create an ElastiCache Serverless cache instead of provisioned nodes. Supported for Redis and Valkey.
+ id: serverless_enabled
+ immutable: true
+ label: Serverless
+ show_when:
+ engine:
+ - redis
+ - valkey
+ type: boolean
+ - default: cache.t4g.micro
+ description: ElastiCache node size for provisioned clusters.
+ id: node_type
+ label: Node type
+ patterns:
+ - message: Node type must start with cache.
+ pattern: ^cache\..+
+ required: true
+ show_when:
+ serverless_enabled: false
+ type: string
+ - default: 1
+ description: Number of Memcached cache nodes.
+ id: num_cache_nodes
+ label: Cache nodes
+ max: 40
+ min: 1
+ show_when:
+ engine: memcached
+ serverless_enabled: false
+ type: number
+ - default: false
+ description: Enable cluster mode when one primary shard is not enough for your data size or throughput. Leave disabled for simpler Redis or Valkey deployments with one primary and optional replicas.
+ id: cluster_mode_enabled
+ label: Cluster mode
+ show_when:
+ engine:
+ - redis
+ - valkey
+ serverless_enabled: false
+ type: boolean
+ - default: 1
+ description: Number of Redis or Valkey shards. Use 1 when cluster mode is disabled.
+ id: num_node_groups
+ label: Node groups
+ max: 500
+ min: 1
+ show_when:
+ cluster_mode_enabled: true
+ engine:
+ - redis
+ - valkey
+ serverless_enabled: false
+ type: number
+ - default: 0
+ description: Number of replica nodes in each Redis or Valkey node group.
+ id: replicas_per_node_group
+ label: Replicas per node group
+ max: 5
+ min: 0
+ show_when:
+ engine:
+ - redis
+ - valkey
+ serverless_enabled: false
+ type: number
+ - collapsible: true
+ description: Port where the cache accepts connections. Leave blank for engine defaults.
+ id: port
+ label: Port
+ max: 65535
+ min: 1
+ type: number
+ - collapsible: true
+ default: ipv4
+ description: Network type for the replication group.
+ id: network_type
+ label: Network type
+ show_when:
+ serverless_enabled: false
+ type: string
+ values:
+ - label: IPv4
+ value: ipv4
+ - label: IPv6
+ value: ipv6
+ - label: Dual stack
+ value: dual_stack
+ - collapsible: true
+ default: ipv4
+ description: IP address discovery method.
+ id: ip_discovery
+ label: IP discovery
+ show_when:
+ serverless_enabled: false
+ type: string
+ values:
+ - label: IPv4
+ value: ipv4
+ - label: IPv6
+ value: ipv6
+ - id: section_security
+ label: Security
+ type: section
+ - default: true
+ description: Create a security group with ingress rules for this cache.
+ id: security_group_creation_enabled
+ label: Security group creation
+ type: boolean
+ - description: Existing security group ID to use when security group creation is disabled.
+ id: security_group_id
+ label: Security group ID
+ patterns:
+ - message: Security group ID must start with sg-.
+ pattern: ^sg-.+
+ required: true
+ show_when:
+ security_group_creation_enabled: false
+ type: string
+ - add_button_label: Add security group ID
+ description: Security groups allowed to connect to this cache.
+ id: allowed_security_group_ids
+ label: Allowed security groups
+ patterns:
+ - message: Security group ID must start with sg-.
+ pattern: ^sg-.+
+ placeholder: sg-...
+ type: string_array
+ - add_button_label: Add CIDR block
+ collapsible: true
+ description: IPv4 CIDR blocks allowed to connect to this cache.
+ id: allowed_cidr_blocks
+ label: Allowed IPv4 CIDR blocks
+ placeholder: 10.0.0.0/16
+ type: string_array
+ - add_button_label: Add IPv6 CIDR block
+ collapsible: true
+ description: IPv6 CIDR blocks allowed to connect to this cache.
+ id: allowed_ipv6_cidr_blocks
+ label: Allowed IPv6 CIDR blocks
+ placeholder: 2001:db8::/64
+ type: string_array
+ - collapsible: true
+ default: true
+ description: Enable TLS encryption for Redis and Valkey traffic.
+ id: transit_encryption_enabled
+ label: Transit encryption
+ show_when:
+ engine:
+ - redis
+ - valkey
+ type: boolean
+ - collapsible: true
+ default: true
+ description: Enable encryption at rest for Redis and Valkey.
+ id: at_rest_encryption_enabled
+ label: At-rest encryption
+ show_when:
+ engine:
+ - redis
+ - valkey
+ type: boolean
+ - collapsible: true
+ description: KMS key ARN for at-rest encryption. Leave blank to use the AWS managed key.
+ id: kms_key_arn
+ label: KMS key ARN
+ placeholder: arn:aws:kms:us-east-1:123456789012:key/abc-123
+ show_when:
+ at_rest_encryption_enabled: true
+ engine:
+ - redis
+ - valkey
+ type: string
+ - collapsible: true
+ default: true
+ description: Generate an AUTH token for Redis or Valkey when no token is provided. Requires transit encryption.
+ id: auth_token_enabled
+ label: AUTH token generation
+ show_when:
+ engine:
+ - redis
+ - valkey
+ transit_encryption_enabled: true
+ type: boolean
+ - collapsible: true
+ description: Optional explicit AUTH token. Leave blank to generate one when AUTH token generation is enabled.
+ id: auth_token
+ label: AUTH token
+ show_when:
+ engine:
+ - redis
+ - valkey
+ transit_encryption_enabled: true
+ type: string
+ - collapsible: true
+ default: 32
+ description: Length of the generated AUTH token.
+ id: auth_token_length
+ label: AUTH token length
+ max: 128
+ min: 16
+ show_when:
+ auth_token_enabled: true
+ engine:
+ - redis
+ - valkey
+ transit_encryption_enabled: true
+ type: number
+ - id: section_availability
+ label: Availability
+ show_when:
+ engine:
+ - redis
+ - valkey
+ serverless_enabled: false
+ type: section
+ - default: false
+ description: Enable automatic failover. Requires at least one replica.
+ id: automatic_failover_enabled
+ label: Automatic failover
+ show_when:
+ engine:
+ - redis
+ - valkey
+ serverless_enabled: false
+ type: boolean
+ - default: false
+ description: Enable Multi-AZ support for the replication group.
+ id: multi_az_enabled
+ label: Multi-AZ
+ show_when:
+ engine:
+ - redis
+ - valkey
+ serverless_enabled: false
+ type: boolean
+ - collapsible: true
+ default: false
+ description: Enable data tiering for r6gd or r7gd node types.
+ id: data_tiering_enabled
+ label: Data tiering
+ show_when:
+ engine:
+ - redis
+ - valkey
+ serverless_enabled: false
+ type: boolean
+ - id: section_backups
+ label: Backups
+ show_when:
+ engine:
+ - redis
+ - valkey
+ type: section
+ - default: 0
+ description: Number of days to retain automatic snapshots. Set to 0 to disable backups.
+ id: snapshot_retention_limit
+ label: Snapshot retention days
+ max: 35
+ min: 0
+ show_when:
+ engine:
+ - redis
+ - valkey
+ serverless_enabled: false
+ type: number
+ - collapsible: true
+ description: Daily UTC window for automatic snapshots.
+ id: snapshot_window
+ label: Snapshot window
+ placeholder: 05:00-09:00
+ show_when:
+ engine:
+ - redis
+ - valkey
+ serverless_enabled: false
+ type: string
+ - collapsible: true
+ description: Final snapshot name to create when deleting the replication group.
... diff truncated ... |
mabadir
approved these changes
Jun 17, 2026
Member
Author
|
@greptile |
Member
Author
|
@greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Greptile Summary
This PR refactors the ElastiCache module's version API, splitting the single optional
engine_versionvariable into two required variables —engine_major_versionandengine_minor_version— and adds a newrvn-elasticache-definition.ymlmodule definition for the Ravion platform. It also changes theenginedefault from"redis"to"valkey"and adds areplication_group_member_cluster_idoutput andtolist(member_clusters)[0]for per-cluster CloudWatch dimension targeting.engine_version(optional,nulldefault) is replaced byengine_major_versionandengine_minor_version(both required, no default);locals.tfcombines them intolocal.engine_versionand simplifies the parameter group family derivation.rvn-elasticache-definition.ymlmaps all 50+ module inputs to Terraform variables for the Ravion UI, including the new version fields and a rich set of CloudWatch metric expressions.tolist(member_clusters)[0], enabling per-cluster metrics; the same pattern is exposed as a newreplication_group_member_cluster_idoutput.Confidence Score: 3/5
Not safe to merge until the breaking-change implications for existing callers are resolved — the default engine switch and required version variables will destroy existing deployments that relied on defaults or omitted engine_version.
Switching
enginedefault from"redis"to"valkey"and makingengine_major_version/engine_minor_versionrequired with no defaults will force every existing caller that omitted these inputs to either update their config or face a plan-time error or an unintended engine-type replacement. These are destructive changes for any live deployment using the module with its previous defaults, and neither the README nor the module definition includes a migration guide.cache/elasticache/variables.tf — the removal of the optional
engine_versiondefault and the engine default change are the source of the breaking-change risk for existing callers.Important Files Changed
engine_version(optional, defaulting null) into two required variablesengine_major_versionandengine_minor_version, and changes theenginedefault from"redis"to"valkey"— both are breaking changes for existing callers.local.engine_versioncombining major/minor, simplifies parameter group family derivation, and switches CloudWatch dimension fromreplication_group.idtotolist(member_clusters)[0]— the set-to-list conversion has spec-undefined ordering.replication_group_member_cluster_idoutput and updatesengine_versionfallback tolocal.engine_version; the new output uses the sametolist(member_clusters)[0]pattern with undefined ordering.var.engine_versionforlocal.engine_versionin both the replication group and cluster resources — straightforward and correct.engine_minor_versionis alwaysrequired: trueeven for serverless caches where version is unused.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["engine_major_version (required)\nengine_minor_version (required)"] --> B["local.engine_version\n= major.minor"] B --> C{Engine type?} C -->|redis/valkey| D["aws_elasticache_replication_group\nengine_version = local.engine_version"] C -->|memcached| E["aws_elasticache_cluster\nengine_version = local.engine_version"] C -->|redis/valkey + serverless| F["aws_elasticache_serverless_cache\n(version not used)"] A --> G["default_parameter_group_family\nredis7 / valkey9 / memcached1.6"] D --> H["member_clusters (set)"] H --> I["tolist(member_clusters)[0]\n⚠ undefined ordering"] I --> J["cloudwatch_dimension_value\n(CacheClusterId)"] I --> K["replication_group_member_cluster_id\n(output)"]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A["engine_major_version (required)\nengine_minor_version (required)"] --> B["local.engine_version\n= major.minor"] B --> C{Engine type?} C -->|redis/valkey| D["aws_elasticache_replication_group\nengine_version = local.engine_version"] C -->|memcached| E["aws_elasticache_cluster\nengine_version = local.engine_version"] C -->|redis/valkey + serverless| F["aws_elasticache_serverless_cache\n(version not used)"] A --> G["default_parameter_group_family\nredis7 / valkey9 / memcached1.6"] D --> H["member_clusters (set)"] H --> I["tolist(member_clusters)[0]\n⚠ undefined ordering"] I --> J["cloudwatch_dimension_value\n(CacheClusterId)"] I --> K["replication_group_member_cluster_id\n(output)"]Comments Outside Diff (1)
cache/elasticache/README.md, line 1 (link)AGENTS.mdstates: "When adding, modifying, or removing modules: 1. Update the Module Directory table in the root README.md." This PR modifies the elasticache module's public API (removesengine_version, addsengine_major_version/engine_minor_version, changes the default engine), but the rootREADME.mdwas not updated.Context Used: AGENTS.md (source)
Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Reviews (3): Last reviewed commit: "fixes" | Re-trigger Greptile
Context used: