FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
RuiChang
Staff
Staff
Article Id 259351
Description

 

This article describes the application of Terraform on FortiManager. Terraform is an open-source tool for the provisioning of devices and is applicable to FortiManager as well.

 

Scope

 

FortiManager.

 

Solution

 

1) Installation of Terraform:

Terraform can be installed on multiple platforms including Linux, MacOS, or Windows. Links are provided below:

https://developer.hashicorp.com/terraform/downloads?product_intent=terraform

 

Note:

Use the command below to check Terraform is installed successfully:

 

terraform - - version

 

2) Enable JSON rpc read-write on admin users:

 

Go to FortiManager -> System Setting -> Admin -> Administrators -> Edit the user -> Select Read-Write on JSON API Access.

 

RuiChang_0-1686109488456.png

 

3) Create a file with .tf for Terraform:

 

RuiChang_0-1686109521772.png

 

4) Configure the .tf for Terraform to apply the configuration on FortiManager:

 

RuiChang_0-1686109544740.png

 

Notes:

Terraform command for FortiManager can be found in the link below:

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

 

5) After all the commands are configured, execute terraform CLI command in the terminal with the sequence below:

 

a) Terraform init.

Terraform init will initiate the provider and plugin for FortiManager:

 

RuiChang_0-1686109569803.png

 

b) Terraform plan.

Terraform plan will preview the changes or configuration performed on FortiManager:

 

RuiChang_0-1686109587249.png

 

c) Terraform apply.

Terraform apply will perform the changes or configuration on the FortiManager.

 

RuiChang_0-1686109605477.png

 

After 3 of the action above is succeeded, the configuration will be applied on FortiManager:

 

RuiChang_0-1686109625588.png

 

Related link:

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