Allow updating custom header values of webhook subscriptions #594
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to allow updating custom header values of webhook subscriptions (AKA webhooks v3).
Currently, changes to the
value
field of these are completely ignored because:-- redacted --
),-- redacted --
values on read,ForceNew; true
setting on thevalue
field useless,To fix this situation, my plan is to:
custom_header
field fromschema.TypeList
toschema.TypeSet
, and let terraform compute a hash from thename
andvalue
for each header item,-- redacted --
(we never know, maybe the API will stop redacting all header values altogether at some point).Alternatives considered:
name
/value
pairs in some field, and mark that field asForceNew; true
.-- redacted --
value. Using a well-known and documented hash function would allow clients of the API to detect drift, and fix it.That last option would be the best IMO, but I figured it will take time to implement on the PagerDuty API side,
and we need a solution in the short term to at least be able to update values.