CheckPointSW / terraform-provider-checkpoint

Terraform provider for Check Point
https://www.terraform.io/docs/providers/checkpoint/
Mozilla Public License 2.0
28 stars 40 forks source link

access rule position not working due to non-unique rule name #76

Closed Sreerag74031 closed 3 years ago

Sreerag74031 commented 3 years ago

access rule resource 'checkpoint_management_access_rule' with position attribute is not working,

we tried to position new rule below existing rule using position = {below = checkpoint_management_access_rule.rule1.name}

however in checkpoint rule name is not unique field, also rule name can be empty or null

getting below is the error:

│ Error: failed to execute API call
│ Status: 400 Bad Request
│ Code: generic_err_object_field_not_unique
│ Message: Requested object name [<name_of_the_rule>] is not unique.

can position rules using any other attribute which is unique and wont cause this issue?

chkp-royl commented 3 years ago

Hi @Sreerag74031 ,

Please check that checkpoint_management_access_rule.rule1.name has value and it's not empty. Also, Do you have two rules with the same name? that's can explain what you get not unique error since we can't know to which rule you refer. In this case, you should use rule uid or make rule name unique.

Regards, Roy

Sreerag74031 commented 3 years ago

Thanks @chkp-royl, using rule uid worked, name was not unique.