Skip to content

Conversation

Benbentwo
Copy link
Contributor

@Benbentwo Benbentwo commented Aug 28, 2025

Summary

  • expose instance and reader/cluster endpoint outputs
  • document new DNS outputs in README

Testing

  • atmos docs generate readme
  • atmos docs generate readme-simple
  • pre-commit run --files README.md src/README.md src/outputs.tf (fails: "iam_roles" module is not found)

https://chatgpt.com/codex/tasks/task_b_68b049e0d0fc832b9f6a2872e4f16a56

Summary by CodeRabbit

  • New Features

    • Added a new input: promotion_tier (number, default 0) to control per-instance failover priority.
    • Added three outputs: cluster_endpoint, reader_endpoint, and instance_endpoints for direct access to Aurora Postgres endpoints.
  • Documentation

    • Updated README Inputs and Outputs sections with descriptions for the new input and outputs.
    • Removed a trailing branding line for a cleaner README.

Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

Added a new input promotion_tier and wired it through to the child module (module version bumped). Added three Terraform outputs (cluster_endpoint, reader_endpoint, instance_endpoints) and documented these additions in READMEs; no runtime logic or error-handling changes.

Changes

Cohort / File(s) Change summary
Module inputs / variables
src/variables.tf
Added variable "promotion_tier" (type = number, default = 0) with description detailing per-instance failover priority and tier scaling.
Module call / version bump
src/cluster-regional.tf
Updated module "aurora_postgres_cluster" version from 1.18.0 to 2.1.1 and passed promotion_tier = var.promotion_tier into the child module.
Terraform outputs
src/outputs.tf
Added outputs: cluster_endpoint, reader_endpoint, instance_endpoints referencing module.aurora_postgres_cluster values with descriptions.
Documentation updates
README.md, src/README.md
Documented new input promotion_tier in Inputs and added outputs (cluster_endpoint, instance_endpoints, reader_endpoint) in Outputs. Removed trailing logo line from src/README.md.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Root as Root Module
  participant Child as aurora_postgres_cluster (v2.1.1)
  participant Outputs as Module Outputs

  rect rgb(240,248,255)
    Root->>Child: pass inputs (including promotion_tier)
    Note right of Child: Child manages cluster/instances
    Child-->>Root: exposes attributes (endpoint, reader_endpoint, instance_endpoints)
    Root->>Outputs: map child attributes to outputs
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit scurries through the codewood trail,
Adds a tier, wires a module, signs a small unveil.
Endpoints bloom like carrots in a row,
Docs hum softly, telling where to go.
Thump-thump—deployment dreams set sail. 🥕

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/expose-instance_endpoints-and-dns-outputs

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.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit 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:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@mergify mergify bot requested review from a team August 28, 2025 12:33
Copy link

mergify bot commented Aug 28, 2025

Important

Do not edit the README.md directly. It's auto-generated from the README.yaml

Please update the README.yaml file instead.

Could you fix it @Benbentwo? 🙏

@mergify mergify bot added the needs-test Needs testing label Aug 28, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
src/outputs.tf (2)

22-30: Good additions; clarify overlap with existing host outputs.

cluster_endpoint/reader_endpoint mirror master_hostname/replicas_hostname values from the same module. Consider documenting the aliasing/deprecation plan to avoid API confusion for consumers.

Would you like me to add a short note to README.yaml indicating:

  • cluster_endpoint ≈ master_hostname (alias)
  • reader_endpoint ≈ replicas_hostname (alias)?

22-35: Optional: declare explicit output types for stability.

Not required, but adding types makes interface clearer.

 output "cluster_endpoint" {
+  type        = string
   value       = module.aurora_postgres_cluster.endpoint
   description = "Postgres cluster endpoint"
 }
 
 output "reader_endpoint" {
+  type        = string
   value       = module.aurora_postgres_cluster.reader_endpoint
   description = "Postgres reader endpoint"
 }
 
 output "instance_endpoints" {
+  type        = list(string)
   value       = module.aurora_postgres_cluster.instance_endpoints
   description = "List of Postgres instance endpoints"
 }
README.md (1)

424-435: Note potential duplication between new and legacy outputs.

Consider a short note that:

  • cluster_endpoint is equivalent to master_hostname
  • reader_endpoint is equivalent to replicas_hostname
    to reduce confusion for consumers.

If acceptable, I’ll add these notes to README.yaml so the generated docs stay consistent.

src/README.md (1)

370-383: Add aliasing note for newly exposed endpoints vs legacy hostnames.

Recommend noting the equivalence to help users choose the preferred outputs.

I can add this to README.yaml and regenerate.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 46b7a91 and 04a703f.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • src/README.md (1 hunks)
  • src/outputs.tf (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (8)
README.md (4)

321-330: Docs build pre-commit failure: iam_roles module path likely causing lookup issues.

../account-map/modules/iam-roles appears in the Modules table and may trigger “module is not found” during pre-commit run. Either ensure the relative path exists in this repo during CI/docs generation or exclude it from docs generation.

I can propose README.yaml adjustments to annotate this module as external or omit unresolved local modules from the generated table. Want me to open a follow-up?


426-426: LGTM: Added cluster_endpoint to Outputs.


430-430: LGTM: Added instance_endpoints to Outputs.


433-433: LGTM: Added reader_endpoint to Outputs.

src/README.md (4)

268-276: Docs build pre-commit failure: iam_roles module path likely causing lookup issues.

Same as root README: the relative path module can break docs checks. Align handling here as well (ensure path exists in CI context or omit from generated table).

I can update README.yaml to avoid listing non-resolvable local modules in generated docs.


374-374: LGTM: Added cluster_endpoint to Outputs.


378-378: LGTM: Added instance_endpoints to Outputs.


381-381: LGTM: Added reader_endpoint to Outputs.

@RoseSecurity
Copy link
Contributor

/terratest

@Benbentwo Benbentwo added the do not merge Do not merge this PR, doing so would cause problems label Aug 28, 2025
@Benbentwo
Copy link
Contributor Author

Need to expose endpoints, but they only exist in latest version of module. Need to see what it takes to update module. Adding Do not merge until then.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
src/README.md (1)

351-351: Tighten grammar and scope note for “promotion_tier”.

Clarify failover wording and explicitly scope the scaling behavior to Serverless v2; convert bare URL to a markdown link.

-<a name="input_promotion_tier"></a> [promotion_tier](#input_promotion_tier) | Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer.<br/><br/>Readers in promotion tiers 0 and 1 scale at the same time as the writer. Readers in promotion tiers 2–15 scale independently from the writer. For more information, see: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.how-it-works.html#aurora-serverless-v2.how-it-works.scaling | `number` | `0` | no |
+<a name="input_promotion_tier"></a> [promotion_tier](#input_promotion_tier) | Instance-level failover priority. Lower tiers have higher priority for promotion to writer.<br/><br/>Serverless v2 note: readers in tiers 0–1 scale with the writer; readers in tiers 2–15 scale independently. See the [Aurora Serverless v2 scaling docs](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.how-it-works.html#aurora-serverless-v2.how-it-works.scaling). | `number` | `0` | no |
README.md (1)

403-403: Polish “promotion_tier” description (grammar + link).

Mirror the clearer wording and Serverless v2 scope note used in src/README.md.

-<a name="input_promotion_tier"></a> [promotion_tier](#input_promotion_tier) | Failover Priority setting on instance level. The reader who has lower tier has higher priority to get promoted to writer.<br/><br/>Readers in promotion tiers 0 and 1 scale at the same time as the writer. Readers in promotion tiers 2–15 scale independently from the writer. For more information, see: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.how-it-works.html#aurora-serverless-v2.how-it-works.scaling | `number` | `0` | no |
+<a name="input_promotion_tier"></a> [promotion_tier](#input_promotion_tier) | Instance-level failover priority. Lower tiers have higher priority for promotion to writer.<br/><br/>Serverless v2 note: readers in tiers 0–1 scale with the writer; readers in tiers 2–15 scale independently. See the [Aurora Serverless v2 scaling docs](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.how-it-works.html#aurora-serverless-v2.how-it-works.scaling). | `number` | `0` | no |
src/cluster-regional.tf (1)

17-17: Pass-through of promotion_tier is correct; consider documenting valid range.

AWS accepts 0–15. Add a validation in variables.tf to enforce bounds.

 variable "promotion_tier" {
   type        = number
   default     = 0
   description = <<-EOT
@@
   EOT
 }
+#
+# Enforce AWS bounds (0–15)
+validation {
+  condition     = var.promotion_tier >= 0 && var.promotion_tier <= 15
+  error_message = "promotion_tier must be between 0 and 15."
+}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 04a703f and 0bba0d9.

📒 Files selected for processing (4)
  • README.md (2 hunks)
  • src/README.md (2 hunks)
  • src/cluster-regional.tf (2 hunks)
  • src/variables.tf (1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~403-~403: There might be a mistake here.
Context: ...tting on instance level. The reader who has lower tier has higher priority to get p...

(QB_NEW_EN)


[grammar] ~403-~403: There might be a mistake here.
Context: ...it-works.scaling | number | 0 | no | | <a name="input_rds_monitoring_interval...

(QB_NEW_EN)

src/README.md

[grammar] ~351-~351: There might be a mistake here.
Context: ...tting on instance level. The reader who has lower tier has higher priority to get p...

(QB_NEW_EN)


[grammar] ~351-~351: There might be a mistake here.
Context: ...it-works.scaling | number | 0 | no | | <a name="input_rds_monitoring_interval...

(QB_NEW_EN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (3)
src/README.md (1)

375-383: Outputs look good; ensure docs reflect module version that provides them.

cluster_endpoint, instance_endpoints, reader_endpoint additions are correct. Verify the “Modules” table shows the rds-cluster version that actually exposes these (your code pins 2.1.1). If the table still lists 1.18.0, update README.yaml so generated docs display 2.1.1.

README.md (1)

427-435: Outputs LGTM; sync module version in docs.

The three new endpoints are valuable. Ensure the “Modules” table reflects cloudposse/rds-cluster/aws v2.1.1 (the code pin) so readers know where these outputs originate. Update README.yaml and regenerate.

src/cluster-regional.tf (1)

8-8: Version bump: verify compatibility and that outputs exist in v2.1.1.

Confirm rds-cluster v2.1.1 exposes endpoint, reader_endpoint, and instance_endpoints and accepts promotion_tier. Run a plan against a fixture to catch any breaking changes from 1.18.0→2.1.1 before lifting “do not merge”.

@Benbentwo
Copy link
Contributor Author

/terratest

@Benbentwo
Copy link
Contributor Author

Removing Do not merge label, 2.0+ upgrade of module is just provider update. added support for new vars.

@Benbentwo Benbentwo removed the do not merge Do not merge this PR, doing so would cause problems label Aug 28, 2025
@Benbentwo
Copy link
Contributor Author

@RoseSecurity PTAL if you get a moment

Copy link
Contributor

@RoseSecurity RoseSecurity left a comment

Choose a reason for hiding this comment

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

Looks great!

@RoseSecurity RoseSecurity enabled auto-merge August 28, 2025 14:55
@mergify mergify bot requested a review from a team August 28, 2025 14:55
@RoseSecurity RoseSecurity added this pull request to the merge queue Aug 28, 2025
Merged via the queue into main with commit 1d2fe2a Aug 28, 2025
19 checks passed
@RoseSecurity RoseSecurity deleted the codex/expose-instance_endpoints-and-dns-outputs branch August 28, 2025 15:50
Copy link

These changes were released in v1.538.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codex needs-test Needs testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants