You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First off, not sure this is the appropriate repository to report the issue, though it can be directly fixed from here.
Problem description
Second, the issue is that certain resources fail (at least, authentik_policy_event_matcher, though I expect similar models to fail as well) due to how models with are being serialized into JSON.
The generated serializer ignores a property and does not include it in the serialized json, if the property is not set. This combined with the terrafom provider code, means that empty properties . For example, the app property from the model_policy_event_matcher, is not set to anything on the serialized JSON when not defined in the resource.
This on it's own is fine, but the authentik API expects it to be defined as either null or enum. And it does not assume null when missing.
These 3 behaviors combined, cause the resource to fail when left empty. Example of a resource that fails with 405 Method Not Allowed:
resource "authentik_policy_event_matcher" "events" {
name = "events"
}
Proposed solution
One possible solution is to always set the property in the terraform provider (to null when empty). An example with app property from model_policy_event_matcher:
First off, not sure this is the appropriate repository to report the issue, though it can be directly fixed from here.
Problem description
Second, the issue is that certain resources fail (at least,
authentik_policy_event_matcher
, though I expect similar models to fail as well) due to how models with are being serialized into JSON.The generated serializer ignores a property and does not include it in the serialized json, if the property is not set. This combined with the terrafom provider code, means that empty properties . For example, the
app
property from themodel_policy_event_matcher
, is not set to anything on the serialized JSON when not defined in the resource.This on it's own is fine, but the authentik API expects it to be defined as either null or enum. And it does not assume null when missing.
These 3 behaviors combined, cause the resource to fail when left empty. Example of a resource that fails with
405 Method Not Allowed
:Proposed solution
One possible solution is to always set the property in the terraform provider (to null when empty). An example with
app
property frommodel_policy_event_matcher
:Edit: Seems like some resources already follow this pattern, so it just needs to be applied to the resources missing it.
Edit 2: Created PR for it: #645
The text was updated successfully, but these errors were encountered: