Skip to content

feat(azure/postgresql): modernize module to pass scorecard#222

Open
tfelix wants to merge 1 commit into
mainfrom
feature/postgresql-scorecard-improvements
Open

feat(azure/postgresql): modernize module to pass scorecard#222
tfelix wants to merge 1 commit into
mainfrom
feature/postgresql-scorecard-improvements

Conversation

@tfelix

@tfelix tfelix commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Bring azure/postgresql up to current conventions (scorecard 53% → 100%), addressing the gaps surfaced on PR #221.

  • buildingblock: migrate from the retired Azure PostgreSQL Single Server (azurerm_postgresql_server) to Flexible Server (azurerm_postgresql_flexible_server); self-contained resource group and globally-unique server name with random suffix
  • backplane: replace the principal_ids role-assignment pattern with the UAMI + WIF convention (user-assigned managed identity, federated identity credential, identity output); role definition targets flexibleServers and keeps */register/action for fresh subscriptions
  • add meshstack_integration.tf wiring the BBD, backplane and OIDC auth
  • add e2e/ smoke test modeled on azure/storage-account
  • drop legacy bb_description.md (superseded by inline BBD readme)

This is the call this needs to be done to test it though:

EDIT: Warning, this is fully AI generated and needs a good checkup. I dont have much background knowledge for terraform. Maybe we can do a f2f review / testrun if this changes work.

The e2e test has not been run live — it needs the pushed ref + Azure fixtures through the smoke-test runner. Given the Single→Flexible Server change, a live run (task hub:e2e:run MODULE=azure/postgresql from meshstack-smoke-test) is the real proof before merge.

Bring azure/postgresql up to current conventions (scorecard 53% → 100%),
addressing the gaps surfaced on PR #221.

- buildingblock: migrate from the retired Azure PostgreSQL Single Server
  (azurerm_postgresql_server) to Flexible Server (azurerm_postgresql_flexible_server);
  self-contained resource group and globally-unique server name with random suffix
- backplane: replace the principal_ids role-assignment pattern with the UAMI + WIF
  convention (user-assigned managed identity, federated identity credential,
  identity output); role definition targets flexibleServers and keeps
  */register/action for fresh subscriptions
- add meshstack_integration.tf wiring the BBD, backplane and OIDC auth
- add e2e/ smoke test modeled on azure/storage-account
- drop legacy bb_description.md (superseded by inline BBD readme)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tfelix tfelix requested a review from grubmeshi July 9, 2026 14:23
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Scorecard Check

Scorecard run on commit 5878d4c8192c4be589bd5439c77fb4ab997f63af relative to origin/main

📊 meshstack-hub Module Scorecard

Generated: 2026-07-09 | Modules scanned: 1 | Categories: 5

📋 Per-Module Category Summary

Score per category per building block. n/a = category does not apply to this module.

Module Overall Core Structure Integration Azure Backplane STACKIT Backplane Testing
azure/postgresql 🟢 100% 🟢 100% 🟢 100% 🟢 100% n/a 🟢 100%

All checks passing! This module meets all scorecard criteria.

Core Structure — ✅ all passing

Basic module file structure and documentation — applies to 1 modules

Module Score 📦 🔗 📋 📝 🖼️ 📌 🔒
azure/postgresql 🟢 100%

Core Structure — Summary

Emoji Criterion Coverage Status
📦 buildingblock/ directory exists 1/1 🟢 100%
🔗 meshstack_integration.tf present 1/1 🟢 100%
📋 buildingblock/APP_TEAM_README.md present (no-integration fallback) n/a
📝 buildingblock/README.md with YAML front-matter 1/1 🟢 100%
🖼️ buildingblock/logo.png included 1/1 🟢 100%
📌 buildingblock/versions.tf present 1/1 🟢 100%
🔒 Provider versions use minimum constraint (>=) 1/1 🟢 100%
Integration — ✅ all passing

meshstack_integration.tf conventions — applies to 1 modules

Module Score 🏷️ 🏢 📤 🔌 📎 🔀 📋 🏷️ 🧱 📖 📝 📊 🚫 🔄
azure/postgresql 🟢 100%

Integration — Summary

Emoji Criterion Coverage Status
🏷️ variable "hub" in integration 1/1 🟢 100%
🏢 variable "meshstack" in integration 1/1 🟢 100%
📤 building_block_definition output exposed 1/1 🟢 100%
🔌 meshcloud/meshstack in required_providers 1/1 🟢 100%
📎 backplane source uses var.hub.git_ref 1/1 🟢 100%
🔀 ref_name uses var.hub.git_ref 1/1 🟢 100%
📋 version_spec.draft uses var.hub.bbd_draft 1/1 🟢 100%
🏷️ BBD metadata.tags forwards var.meshstack.tags 1/1 🟢 100%
🧱 BBD input argument vars with optional() have explicit defaults 1/1 🟢 100%
📖 BBD readme field present 1/1 🟢 100%
📝 BBD readme starts with plain-text description (no heading) 1/1 🟢 100%
📊 BBD readme has shared responsibility table (✅/❌) 1/1 🟢 100%
🚫 No documentation_md output in backplane 1/1 🟢 100%
🔄 meshstack_platform has lifecycle ignore_changes = [availability] n/a
Azure Backplane — ✅ all passing

Azure UAMI-based automation principal conventions — applies to 1 modules

Module Score 🪪 🚫 🚫 🔑 🔗 🧹 📤 📍
azure/postgresql 🟢 100%

Azure Backplane — Summary

Emoji Criterion Coverage Status
🪪 Uses azurerm_user_assigned_identity 1/1 🟢 100%
🚫 No azuread_application resources 1/1 🟢 100%
🚫 No azuread_service_principal resources 1/1 🟢 100%
🔑 No azuread_application_password resources 1/1 🟢 100%
🔗 Uses azurerm_federated_identity_credential 1/1 🟢 100%
workload_identity_federation is non-nullable 1/1 🟢 100%
🧹 No create_service_principal_name toggle 1/1 🟢 100%
📤 Outputs identity (client_id, principal_id, tenant_id) 1/1 🟢 100%
📍 Integration has azure_location 1/1 🟢 100%
STACKIT Backplane — not applicable

STACKIT WIF-based automation principal conventions — applies to 0 modules

No applicable modules.

Testing — ✅ all passing

End-to-end test coverage — applies to 1 modules

Module Score ⚙️ 🧪
azure/postgresql 🟢 100%

Testing — Summary

Emoji Criterion Coverage Status
⚙️ backplane/ directory (optional tier) 1/1 🟢 100%
🧪 e2e/ test directory exists 1/1 🟢 100%
e2e/ contains .tftest.hcl files 1/1 🟢 100%

@aws-amplify-eu-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-222.d1o16zfeoh2slu.amplifyapp.com

@grubmeshi grubmeshi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, let's have look together and we should test this, preferrably using a smoke test using our Azure dev infra.

"Microsoft.DBforPostgreSQL/servers/firewallRules/write",
"Microsoft.DBforPostgreSQL/servers/databases/read",
"Microsoft.DBforPostgreSQL/servers/databases/write"
# resource provider registration — required on freshly created subscriptions

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

n: in particular this stuff here could be hallucinated or outdated.

location = var.location
}

resource "azurerm_user_assigned_identity" "backplane" {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

s:

Suggested change
resource "azurerm_user_assigned_identity" "backplane" {
resource "azurerm_user_assigned_identity" "this" {

the module is already called backplane. I've always wanted to have a rule "single resource type in model must be named this. We should add this to the scorecard.


| Responsibility | Platform Team | Application Team |
| ----------------------------------------------------- | :-----------: | :--------------: |
| Provision and configure the PostgreSQL server | ✅ | ❌ |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

f: this whole section (and probably readme) does not make much sense anymore. Postgres Flex is indeed a (single) DB as a Service, you don't see the actual server anymore AFAIUIT.

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