Closed paulzerkel closed 9 months ago
Hi @paulzerkel , Thanks for sharing this issue. Documentation is indeed confusing and we will make it more clear but Check Point provider assume you force name uniqueness in your environment which is our best practice when working with our APIs (provider is based on Management API), so using object name in configuration is good enough and also more readably. When adding new service via Management API you get an error if a service with same name already exists so ignoring such errors might cause impact on other services like the provider.
Regards, Roy
Hi @chkp-royl,
Is the UID a supported field when specifying sources, destinations, and services in a checkpoint_management_access_rule
resource?
pz
In terms of Management API we support both UID/name as object identifier when reference an object but in the provider we support only names which is our standard
@chkp-royl Would you / Check Point be open to a design, proof of concept, or PR in order to handle both UID and names without the churn shown above in the provider? The service situation alone is enough for us to want this feature. We need to work with services that only differ by casing, which means that we must use the UID and therefore can never have a clean plan.
@paulzerkel We added in provider v2.7.0 new field called fields_with_uid_identifier to access rule resource that gives user control in which resource fields the provider will use UID as object identifier (instead of name)
Thanks
Many resources in the provider can accept either a UID or a name. For example from the checkpoint_management_access_rule resource:
It seems that the provider will only read the
name
of the field, though. This results in two problems:A simple reproduction of this would be to
apply
a config like the following:A subsequent
plan
with no changes to the config outputs the following:Note the churn from the UID to the name, and then back from the name to the UID. Planning with
refresh=false
, of course, makes it so that the names are not read in, but that isn't a great solution in the event other real changes have happened.If
apply
is run on the config, again with no changes, then the CMA reports a session with a lock and two changes, which should not be needed.This was tested with version 1.8.0 and 2.2.0 of the provider.
Would it be feasible to change the provider so that if a UID is used in the config it is what is subsequently used in the read operations versus the name? The challenge here is that there are cases where the UID must be used such as more than one service with a given name exists in a CMA.