Skip to content

feat: add write-only argument helpers#3210

Merged
dd-mergequeue[bot] merged 1 commit intomasterfrom
mf/APIR-1590/write-only-poc
Jan 6, 2026
Merged

feat: add write-only argument helpers#3210
dd-mergequeue[bot] merged 1 commit intomasterfrom
mf/APIR-1590/write-only-poc

Conversation

@LiuVII
Copy link
Copy Markdown
Contributor

@LiuVII LiuVII commented Sep 5, 2025

APIR-2172

Summary

Add reusable helpers for implementing write-only secret attributes in Terraform Provider Framework resources.

Changes

  • WriteOnlySecretConfig - Configuration struct for dual-mode secret support (plaintext + write-only)
  • CreateWriteOnlySecretAttributes() - Generates schema attributes with ExactlyOneOf validators and write-only mode
  • WriteOnlySecretHandler - Manages secret retrieval with two update patterns:
  • Partial updates (SecretRequiredOnUpdate=false): Only sends secret when version trigger changes
  • Full updates (SecretRequiredOnUpdate=true): Always includes secret in API calls
  • SecretResult - Return type with Value, ShouldSetValue, and Diagnostics

Test Plan

  • Table-driven tests for GetSecretForCreate and GetSecretForUpdate
  • Tests cover both SecretRequiredOnUpdate modes
  • Tests verify version trigger change detection

@LiuVII LiuVII force-pushed the mf/APIR-1590/write-only-poc branch from f69e8be to 79abe34 Compare December 19, 2025 15:00
@LiuVII LiuVII changed the title POC: write-only attributes feat: add write-only argument helpers Dec 19, 2025
@LiuVII LiuVII force-pushed the mf/APIR-1590/write-only-poc branch from 79abe34 to 42142e3 Compare December 22, 2025 13:56
@LiuVII LiuVII marked this pull request as ready for review December 22, 2025 13:57
@LiuVII LiuVII requested a review from a team as a code owner December 22, 2025 13:57
@LiuVII LiuVII requested a review from St0rmingBr4in December 22, 2025 14:26
@LiuVII LiuVII requested a review from fpighi December 29, 2025 14:34
Comment thread datadog/internal/fwutils/writeonly_helpers_test.go Outdated
Comment thread go.mod
Comment thread datadog/internal/fwutils/writeonly_helpers.go Outdated
@LiuVII LiuVII force-pushed the mf/APIR-1590/write-only-poc branch from 42142e3 to 25fe8b0 Compare January 5, 2026 15:36
@LiuVII LiuVII force-pushed the mf/APIR-1590/write-only-poc branch from 25fe8b0 to b2a5d4b Compare January 5, 2026 16:08
@LiuVII LiuVII requested a review from fpighi January 5, 2026 16:10
@LiuVII
Copy link
Copy Markdown
Contributor Author

LiuVII commented Jan 6, 2026

/merge

@dd-devflow-routing-codex
Copy link
Copy Markdown

dd-devflow-routing-codex Bot commented Jan 6, 2026

View all feedbacks in Devflow UI.

2026-01-06 11:54:37 UTC ℹ️ Start processing command /merge


2026-01-06 11:54:43 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 31m (p90).


2026-01-06 12:24:09 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue Bot merged commit fab069b into master Jan 6, 2026
14 checks passed
@dd-mergequeue dd-mergequeue Bot deleted the mf/APIR-1590/write-only-poc branch January 6, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants