fortinetdev / terraform-provider-fortimanager

Mozilla Public License 2.0
10 stars 9 forks source link

Add policy block possible? #43

Closed davvelito85 closed 3 months ago

davvelito85 commented 1 year ago

Hi Is it possible to create a policy block using this provider? Based on resource searches in the tf provider and searching the docs for the provider (api call for creating a policy block (url /pm/block/adom/xxx)) it seems not but I would like to have this confirmed.

Thanks

lix-fortinet commented 1 year ago

Hi @davvelito85,

Thank you for raising this issue. We will add a new resource for policy block on the next release.

Thanks, Xing

davvelito85 commented 11 months ago

Thanks!

Also does the current version of the provider support appending a policy block to a package/policy? If so, I'm finding it hard to figure out what value the "_policy_block" argument is expecting?

maetthew commented 10 months ago

Is this issue resolved with 1.9.0?

MaxxLiu22 commented 9 months ago

Hi @davvelito85 @maetthew ,

Sorry for the late update, we have added fortimanager_packages_pblock resource into FortiManager Provider 1.9.0, you can add additional blocks into Policy Blocks through that resource, fortimanager_packages_pkg resource could be used to create policy package folders, policy block can only be added into the existing Policy Blocks folder by now. Please let me know if that doesn't solve your questions or I misunderstand your questions.

resource "fortimanager_packages_pblock" "labelname" {
  name = "terraform_pblock"
  type = "pkg"
  packagesettings{
    ngfw_mode = "profile-based"
  }
}

resource "fortimanager_packages_pkg" "trname" {
  name = "terr-pkg"
  type = "folder"
}

Thanks, Maxx

MaxxLiu22 commented 3 months ago

Hi everyone,

I will proceed with closing this case. If you continue to experience any issues, please feel free to reopen it or open a new case.

Thank you, Maxx