feat(terraform): prefer write-only PostgreSQL password arguments#481
feat(terraform): prefer write-only PostgreSQL password arguments#481davidspielmann wants to merge 5 commits into
Conversation
|
@microsoft-github-policy-service agree |
|
@davidspielmann thank you so much for this PR and the details in the issue. This is definitely something we want to include, though given the changes in provider versions, we have some pre-work to do before your changes can merge. The issue #484 tracks this. Once that is closed, you will need to rebase this branch and update any remaining work. One of the things you will need to do is ensure you run some of the commands to update generated docs like I believe for now you can wait for our sign to have the version upgrade done before you spend any time on this PR. Thank you! |
|
@davidspielmann thank you for your patience. The PR #487 has now been merged, and versions.tf upgraded. You can now rebase and add your proposed changes (small conflict you can rebase clean and go from there). |
5d373f2 to
13fac81
Compare
|
Thank you again for the guidance and for getting the version upgrade merged. I have rebased this PR onto the current main branch, resolved the conflicts, and regenerated the Terraform docs with I believe that should be everything from my side for now? If not, please let me know :) |
katriendg
left a comment
There was a problem hiding this comment.
Thank you for your changes, and docs all look good.
No changes in blueprints, which is fine because of the default value. Looks good to merge, appreciate your contribution @davidspielmann
|
Thank you for this contribution and for your patience working through the version upgrade dependency. A question about blueprint deployments: with the switch to Before this change, updating The |
📚 Documentation Health ReportGenerated on: 2026-05-15 10:35:44 UTC 📈 Documentation Statistics
🏗️ Three-Tree Architecture Status
🔍 Quality Metrics
This report is automatically generated by the Documentation Automation workflow. |
📚 Documentation Health ReportGenerated on: 2026-05-15 10:42:32 UTC 📈 Documentation Statistics
🏗️ Three-Tree Architecture Status
🔍 Quality Metrics
This report is automatically generated by the Documentation Automation workflow. |
|
Thanks @rezatnoMsirhC, that makes sense. Using the write-only arguments turns out to be more involved than I initially expected. I have added
The variable defaults to |
|
Yes, please add Both blueprints delegate their PostgreSQL configuration directly to The pattern is the same as what you applied to the other three blueprints: declare a postgresql_admin_password_wo_version = var.postgresql_admin_password_wo_versionAfter making those changes, run |
|
Thank you, I added |
|
Thanks @davidspielmann, the changes to both |
Addresses #355 (or a first attempt...)
Pull Request
Description
This PR improves the PostgreSQL Flexible Server admin password flow by using AzureRM write-only password arguments where supported.
The change reduces future persistence of the PostgreSQL admin password in Terraform artifacts by replacing standard password arguments with write-only alternatives.
It updates the PostgreSQL Terraform component to prefer AzureRM write-only password arguments where supported.
Related Issue
Relates to #355
Type of Change
Implementation Details
This PR updates the PostgreSQL Terraform component to prefer write-only arguments for the admin password flow. I have changed the following:
valueargument withvalue_wovalue_wo_versionfor the Key Vault admin password secretadministrator_passwordwithadministrator_password_woadministrator_password_wo_versionadmin_password_wo_versionas a configurable version value for write-only password updates>= 1.9.8to>= 1.12.0, because write-only arguments require Terraform 1.11 or later.Testing Performed
terraform fmtandterraform validateforsrc/000-cloud/035-postgresql/terraformValidation Steps
Checklist
terraform fmton all Terraform codeterraform validateon all Terraform codeaz bicep formaton all Bicep codeaz bicep buildto validate all Bicep codeSecurity Review
Additional Notes
There may be additional future potential to further reduce sensitive value persistence by adopting Terraform ephemeral values, such as replacing managed password generation with an
ephemeral "random_password"block where appropriate. That is intentionally left out of this PR to keep the scope rather small.