Skip to content

fix(bug): INFRA-1007 Use mysql major version in var, only - #359

Merged
j7m4 merged 2 commits into
mainfrom
j7m4/infra-1007
Jul 22, 2025
Merged

fix(bug): INFRA-1007 Use mysql major version in var, only#359
j7m4 merged 2 commits into
mainfrom
j7m4/infra-1007

Conversation

@j7m4

@j7m4 j7m4 commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Updated default database engine version values to use the more general "8.0" instead of specific patch versions.
    • Clarified version descriptions to specify that only the major version is required.

@linear

linear Bot commented Jul 22, 2025

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jul 22, 2025

Copy link
Copy Markdown
Contributor
## Walkthrough

The changes update the default values of two variables related to database engine versions in Terraform configuration files. Both variables now use the generic version "8.0" instead of previously specified Aurora MySQL version strings. The description of one variable was clarified to indicate it expects only the major version. No other modifications were made to variable types or attributes.

## Changes

| File(s)                           | Change Summary                                                                                   |
|----------------------------------|------------------------------------------------------------------------------------------------|
| modules/database/variables.tf     | Updated description for `engine_version` to specify major version only; changed default from `"8.0.mysql_aurora.3.05.2"` to `"8.0"` |
| variables.tf                     | Changed default for `database_engine_version` from `"8.0.mysql_aurora.3.07.1"` to `"8.0"`        |

## Estimated code review effort

1 (~2 minutes)

## Poem

> A hop, a skip, a version tweak,  
> Aurora specifics no longer we seek.  
> "8.0" is now the chosen tune,  
> Making our configs simple and immune.  
> With every change, a carrot earned—  
> For tidy code, this bunny's learned! 🥕

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b0daae and ef46d73.

📒 Files selected for processing (1)
  • modules/database/variables.tf (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • modules/database/variables.tf

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@j7m4 j7m4 changed the title INFRA-1007: Use mysql major version in var, only fix(bug): INFRA-1007 Use mysql major version in var, only Jul 22, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (1)
modules/database/variables.tf (1)

27-31: Type mismatch: create_db_subnet_group is string but default is true
Terraform will error because true is not a string.

-variable "create_db_subnet_group" {
-  description = "Determines whether to create the databae subnet group or use existing"
-  type        = string
-  default     = true
-}
+variable "create_db_subnet_group" {
+  description = "Whether to create the database subnet group (true) or use an existing one (false)"
+  type        = bool
+  default     = true
+}
♻️ Duplicate comments (1)
variables.tf (1)

56-60: Same concern: "8.0" may not pass provider validation
For consistency and to avoid deployment failures, keep the fully-qualified Aurora version or default to null.

🧹 Nitpick comments (2)
modules/database/variables.tf (1)

21-23: Minor: spelling / clarity
"Version for MySQL Auora to use" → "Version of Aurora MySQL to use".

variables.tf (1)

56-58: Clarify description
Consider stating “Aurora MySQL engine version (e.g. 8.0.mysql_aurora.3.x.x)” so callers know the expected format.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a18112 and 0b0daae.

📒 Files selected for processing (2)
  • modules/database/variables.tf (1 hunks)
  • variables.tf (1 hunks)

Comment on lines 21 to 25
variable "engine_version" {
description = "Version for MySQL Auora to use"
type = string
default = "8.0.mysql_aurora.3.05.2"
default = "8.0"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Default "8.0" is very likely invalid for Aurora-MySQL
Aurora requires the full engine patch string (e.g. 8.0.mysql_aurora.3.05.2). Supplying only the major ("8.0") makes aws_rds_cluster fail with

InvalidParameterValue: 1 validation error detected: Value '8.0' at 'engineVersion'
  1. Keep the previous explicit version or set the default to null and let callers decide.
  2. At minimum, add a note in the description that a full patch version is expected.

#!/bin/bash
set -e

echo "=== variables.tf snippet (first 50 lines) ==="
sed -n '1,50p' modules/database/variables.tf || true

echo -e "\n=== occurrences of 'engine_version' in modules ==="
rg -n "engine_version" -n modules || true

echo -e "\n=== occurrences of aws_rds_cluster in modules ==="
rg -n "aws_rds_cluster" -n modules || true

🌐 Web query:

Does Terraform’s aws_rds_cluster engine_version parameter accept short versions like "8.0" for Aurora MySQL, or must it be the full engine version string such as "8.0.mysql_aurora.3.05.2"?

💡 Result:

In Terraform, when configuring an aws_rds_cluster resource for Aurora MySQL, the engine_version parameter requires the full engine version string, such as "5.7.mysql_aurora.2.07.6". Short versions like "5.7" are not accepted. This is because AWS RDS uses a specific versioning scheme for Aurora MySQL, which includes the major version, the .mysql_aurora identifier, and the Aurora-specific version number. (provose.com)

For example, to specify Aurora MySQL version 5.7 with Aurora version 2.07.6, you would set:

resource "aws_rds_cluster" "example" {
  engine        = "aurora-mysql"
  engine_version = "5.7.mysql_aurora.2.07.6"
  # ... other parameters ...
}

Using a short version like "5.7" will result in an error, as Terraform expects the full version string. This requirement aligns with AWS's versioning format for Aurora MySQL. (provose.com)

Therefore, always specify the complete engine version when configuring Aurora MySQL clusters in Terraform.

Citations:


Default engine_version must include the full Aurora MySQL patch string
Aurora-MySQL’s engine_version parameter does not accept just “8.0” and will fail with:

InvalidParameterValue: 1 validation error detected: Value '8.0' at 'engineVersion'

You should either:

  • Provide a known full version as the default (e.g. "8.0.mysql_aurora.3.05.2"), or
  • Set default = null and require callers to specify the full version.

Also update the variable’s description to call out that a full patch‐level version is required.

Locations to update:

  • modules/database/variables.tf (lines 21–25)

Suggested diff:

 variable "engine_version" {
-  description = "Version for MySQL Auora to use"
+  description = "Aurora MySQL full engine version (e.g. 8.0.mysql_aurora.3.05.2)"
   type        = string
-  default     = "8.0"
+  default     = null   # callers must supply full version, e.g. 8.0.mysql_aurora.3.05.2
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
variable "engine_version" {
description = "Version for MySQL Auora to use"
type = string
default = "8.0.mysql_aurora.3.05.2"
default = "8.0"
}
variable "engine_version" {
description = "Aurora MySQL full engine version (e.g. 8.0.mysql_aurora.3.05.2)"
type = string
default = null # callers must supply full version, e.g. 8.0.mysql_aurora.3.05.2
}
🤖 Prompt for AI Agents
In modules/database/variables.tf lines 21 to 25, update the variable
"engine_version" to require a full Aurora MySQL patch-level version string
instead of just "8.0". Change the default value to a complete version string
like "8.0.mysql_aurora.3.05.2" or set the default to null to force callers to
specify it. Also, revise the description to clearly state that a full
patch-level version is required for the engine_version variable.

@j7m4
j7m4 merged commit 44ca372 into main Jul 22, 2025
8 checks passed
@j7m4
j7m4 deleted the j7m4/infra-1007 branch July 22, 2025 23:13
jsbroks pushed a commit that referenced this pull request Jul 22, 2025
### [7.14.4](v7.14.3...v7.14.4) (2025-07-22)

### Bug Fixes

* **bug:** INFRA-1007 Use mysql major version in var, only ([#359](#359)) ([44ca372](44ca372))
@jsbroks

jsbroks commented Jul 22, 2025

Copy link
Copy Markdown
Contributor

This PR is included in version 7.14.4 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants