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

acces rule import issue #53

Closed Sreerag74031 closed 3 years ago

Sreerag74031 commented 3 years ago

Getting below error while trying to import acces rule

Error: invalid unique identifier format. UID format: ;

command used terraform import checkpoint_management_access_rule.rule2 <LAYER_NAME>;<RULE_UID>

chkp-royl commented 3 years ago

Hi @Sreerag74031, Thanks for posting this issue. Please notice you need to replace the values of and with the existing values. For example: Access rule from layer Network with rule UID 9423d36f-2d66-4754-b9e2-e9f4493751d3, use the following command: terraform import checkpoint_management_access_rule.example Network;9423d36f-2d66-4754-b9e2-e9f4493751d3

Thanks, Roy

Sreerag74031 commented 3 years ago

After some testing found that ";" is resulting in UID as a command in bash. Using quotes worked like below terraform import checkpoint_management_access_rule.example "Network;9423d36f-2d66-4754-b9e2-e9f4493751d3"

Draxter commented 3 years ago

@chkp-royl Might be worth adding a note about it in the documentation, this a such a trap. In most environments, the semicolon will cause the shell to split the command.