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

Import and Updating an existing access rule #50

Closed SMBurrows closed 3 years ago

SMBurrows commented 4 years ago

I have found a bug but I'm not sure if it's a bug with the provider or the Check Point API.

When importing an access_rule that does not have a name set the terraform.tfstate file shows: R80.40 name: null R80.10 name: ""

Updating this object an running a plan would correctly show a change in the plan, however when you apply the Check Point API returns a 500 error:

Error: failed to execute API call
Status: 500 Server Error
Code: generic_internal_error
Message: Internal error. For more info search for incident [c02ec9a3-954e-43fd-b697-b625adcd95ae] in log file 

I noticed that in an R80.40 environment that the tfstate file updates itself after this error and populates the name of the access rule with it's UID, then running apply again - it works.

In R80.10 the name always stays as an empty string and repeatably fails.

So I've found that manually setting the name in the state file before applying will "fix" the problem but not much of a solution.

chkp-royl commented 4 years ago

Hi @SMBurrows , Thanks for posting this issue. I think because name is optional, we need to execute set-access-rule using rule UID. We will investigate it and hope to fix that in the next version of Check Point provider.

Thanks, Roy

chkp-royl commented 3 years ago

Hi @SMBurrows, We fixed this bug in the new release of Check Point provider v1.2.0. Please upgrade the provider to latest version and try again.

Regards, Roy