Closed neinkob15 closed 1 year ago
Thanks for notifying us, it will be checked.
Hi @neinkob15 , We fixed exception group position in provider version 2.3.0. Please use this version and let us know if you still face any issue.
Regards, Roy
Hi, I still have an issue with this one. I am using the new version 2.3.0 The creation of an exception group with the position is now working correctly. However, the update of the position does not work:
See this example:
resource checkpoint_management_exception_group gr1 {
apply_on = "manually-select-threat-rules"
applied_threat_rules {
layer = "Terraform_gbl Threat Prevention"
name = "first_rule"
position = {
below = "id1"
}
}
name = "Some Exception Group"
}
If I change the position argument in this resource from id1 to id2, it would error with the following message:
╷
│ Error: failed to execute API call
│ Status: 400 Bad Request
│ Code: generic_err_missing_required_parameters
│ Message: Missing parameter: [applied-threat-rules.0.layer]
│
│ with checkpoint_management_exception_group.gr1,
│ on main.tf line 21, in resource "checkpoint_management_exception_group" "gr1":
│ 21: resource checkpoint_management_exception_group gr1 {
│
This is because in the "updateManagementExceptionGroup"-function, it does include the layer-attribute only if it changed, and the api backend does expect the layer attribute always.
Seems correct. we need to take all parameters in case applied-threat-rules
has changed.
We will fix that in the next release, re-open issue to let everyone know about it.
Bug was fixed. please use latest provider. thanks.
I am currently trying to create a resource of type "exception_group" and applying that to a threat-rule.
This is the relevant Terraform code I'm using:
The result I get is a provider-panic with the following stack-trace:
I looked up the problem in the source code and I found this line: https://github.com/CheckPointSW/terraform-provider-checkpoint/blob/ba65f5d4377a7adb48b29964a32c4a0302183cf5/checkpoint/resource_checkpoint_management_exception_group.go#L155 where it tries to convert the position attribute (v) of type Map/Object into a string.
I would be happy about a fix :)