Skip to content

Add output for PostgreSQL database name#191

Merged
Migara-Pramod merged 1 commit intomainfrom
Migara-Pramod-patch-1
Dec 23, 2025
Merged

Add output for PostgreSQL database name#191
Migara-Pramod merged 1 commit intomainfrom
Migara-Pramod-patch-1

Conversation

@Migara-Pramod
Copy link
Contributor

@Migara-Pramod Migara-Pramod commented Dec 23, 2025

Purpose

This pull request adds a new output to the PostgreSQL Flexible Server Database Terraform module, making the database name available as an output variable.

Outputs improvement:

  • Added a new output variable postgresql_db_name to outputs.tf to expose the database name, allowing other modules or resources to reference it directly.

Summary by CodeRabbit

  • New Features
    • Added new output to expose PostgreSQL Flexible Server Database name, enabling improved infrastructure resource access and configuration management.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

Walkthrough

A new Terraform output named postgresql_db_name was added to the PostgreSQL Flexible Server Database module. This output returns the name attribute of the PostgreSQL database resource, paralleling the existing postgresql_db_id output.

Changes

Cohort / File(s) Summary
PostgreSQL Database Output
modules/azurerm/PostgreSQL-Flexible-Server-Database/outputs.tf
Added new output postgresql_db_name to expose the database name attribute

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A database name, now made plain,
Through outputs it flows like gentle rain,
One line added, simple and sweet,
Making the module more complete! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description covers the Purpose and provides details about the change, but is missing most of the required template sections such as Goals, Approach, User stories, Release notes, and others. While the core purpose is explained, consider following the full template structure including Goals, Approach, and other relevant sections for consistency with repository standards.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding a new output for the PostgreSQL database name in the Terraform module.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Migara-Pramod-patch-1

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f7f3258 and 950ed90.

📒 Files selected for processing (1)
  • modules/azurerm/PostgreSQL-Flexible-Server-Database/outputs.tf

Comment on lines +17 to +20
output "postgresql_db_name" {
value = azurerm_postgresql_flexible_server_database.postgresql_database.name
depends_on = [azurerm_postgresql_flexible_server_database.postgresql_database]
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove the redundant depends_on clause and add a description.

The output correctly exposes the database name, but the explicit depends_on is unnecessary since Terraform automatically tracks dependencies through the value reference. Remove it and add a description for clarity:

 output "postgresql_db_name" {
+  description = "The name of the PostgreSQL Flexible Server Database"
   value      = azurerm_postgresql_flexible_server_database.postgresql_database.name
-  depends_on = [azurerm_postgresql_flexible_server_database.postgresql_database]
 }
🤖 Prompt for AI Agents
In modules/azurerm/PostgreSQL-Flexible-Server-Database/outputs.tf around lines
17-20, remove the redundant depends_on attribute from the postgresql_db_name
output (Terraform already infers the dependency via the value reference) and add
a description field to the output describing what it exposes (e.g., "Name of the
PostgreSQL flexible server database") to improve clarity.

@Migara-Pramod Migara-Pramod merged commit 5eaabd2 into main Dec 23, 2025
9 checks passed
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.

2 participants