Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
Kakakaz75
New Contributor

Terraform add device to Policy Package on FortiManager

Spoiler
 

HI All

I want to associate a Fortimanager Package to installation Target by Terraform

I using Fortimanager provider on Terraform and I create a Package with fortimanager_packages_pkg, but i not able to associate this package with my Fortigate device.

fortimanager_install_targets.jpg

 

 

Do you have any idea?

I search this command on Terraform Providers

https://registry.terraform.io/providers/fortinetdev/fortimanager/latest/docs

I'll try on terraform code, as describe below, with scopemember option, but give error

 

resource "fortimanager_packages_pkg" "ProvaToto_Pgk_Label" {
#crea il packages ProvaToto
  name = "ProvaToto_Pgk"
  type = "pkg"
  scopemember = {
	nme = "FortiGate-VM"
	}
}

 

image001.png

Thanks a lot

Maurizio

5 REPLIES 5
Jean-Philippe_P
Moderator
Moderator

Hello Kakakaz75, 

 

Thank you for using the Community Forum. I will seek to get you an answer or help. We will reply to this thread with an update as soon as possible. 

 

Thanks, 

Jean-Philippe - Fortinet Community Team
Jean-Philippe_P
Moderator
Moderator

Hello again Kakakaz75,

 

I found the same error in a different forum:

https://stackoverflow.com/questions/62361263/terraform-plan-returns-the-error-unsupported-argument

 

Can you tell us if it helped, please?

 

Thanks,

Jean-Philippe - Fortinet Community Team
Kakakaz75

Hello Jean

 

thanks for you replay, but that idea are not valide for my case.

 

Maurizio

heng
Staff
Staff

Hi there, 

 

May I know what is the FMG version and the ADOM version (is it ADOM enable)? 

NSE8
heng
Staff
Staff

Hi there, 

 

Your code have some issue, the correct sample as follows, 

 

1) scopemember  is a block, you should not have the equal =

2) The key vdom is mandatory for the  scopemember  block.

 

 

 

resource "fortimanager_packages_pkg" "ProvaToto_Pgk_Label" {
#crea il packages ProvaToto
  name = "ProvaToto_Pgk"
  type = "pkg"
  scopemember {
	name = "FortiGate-VM"
        vdom = "root" 
	}
}

 

 

 

 

Sample:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create

Terraform will perform the following actions:

# fortimanager_packages_pkg.ProvaToto_Pgk_Label will be created
+ resource "fortimanager_packages_pkg" "ProvaToto_Pgk_Label" {
+ dynamic_sort_subtable = "false"
+ id = (known after apply)
+ name = "ProvaToto_Pgk"
+ objver = (known after apply)
+ oid = (known after apply)
+ scopetype = "inherit"
+ type = "pkg"

+ scopemember {
+ name = "FortiGate-VM"
+ vdom = "root"
}
}

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

Enter a value: yes

fortimanager_packages_pkg.ProvaToto_Pgk_Label: Creating...
fortimanager_packages_pkg.ProvaToto_Pgk_Label: Creation complete after 0s [id=ProvaToto_Pgk]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

 

image.png

 

NSE8
Announcements

Select Forum Responses to become Knowledge Articles!

Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

Labels
Top Kudoed Authors