Fortinet white logo
Fortinet white logo

OCI Administration Guide

Deploying FortiGate-VM using Terraform in the CLI

Deploying FortiGate-VM using Terraform in the CLI

This section includes explanation of how to add bootstrapping of FortiGate CLI commands and a BYOL license at the time of initial bootup as part of a Terraform deployment.

See the corresponding files:

To deploy FortiGate-VM using Terraform in the CLI:
  1. See Deployment of a single FortiGate-VM on the Oracle Cloud Infrastructure (OCI).
  2. Bootstrap the FortiGate-VM at initial bootup:
    1. Replace the following lines in config.conf with your own FortiOS CLI commands:

      config system global

      set hostname OCI-Single

      end

      config system interface

      edit port1

      set alias untrust

      next

      edit port2

      set alias trust

      set mode static

      set ip ${port2_ip} ${port2_mask}

      next

      end

    2. To bootstrap a FortiGate-VM license, obtain one from Customer Service & Support after registering your product code. Save the license file as licence.lic. FortiGate-VM license content resembles the following:

    3. Bootstrap the license file as described at the end of the following scripts: main and variables.
    4. Place the license.lic file in the same directory as the other Terraform definition files in your working directory so that the next step will parse and process it automatically.
    5. Run Terraform as described in Using Terraform to deploy a single FortiGate-VM.
    6. After deployment, log into the FortiGate by accessing https://<IP_address> in your browser. The system displays the dashboard instead of a license upload window, since the license is already activated.

      To see how bootstrapping went, check if the command was successfully run. Open the CLI console and enter diag debug cloudinit show.

      If the cloud-init was run successfully, the CLI shows Finish running script with no errors.

Deploying FortiGate-VM using Terraform in the CLI

Deploying FortiGate-VM using Terraform in the CLI

This section includes explanation of how to add bootstrapping of FortiGate CLI commands and a BYOL license at the time of initial bootup as part of a Terraform deployment.

See the corresponding files:

To deploy FortiGate-VM using Terraform in the CLI:
  1. See Deployment of a single FortiGate-VM on the Oracle Cloud Infrastructure (OCI).
  2. Bootstrap the FortiGate-VM at initial bootup:
    1. Replace the following lines in config.conf with your own FortiOS CLI commands:

      config system global

      set hostname OCI-Single

      end

      config system interface

      edit port1

      set alias untrust

      next

      edit port2

      set alias trust

      set mode static

      set ip ${port2_ip} ${port2_mask}

      next

      end

    2. To bootstrap a FortiGate-VM license, obtain one from Customer Service & Support after registering your product code. Save the license file as licence.lic. FortiGate-VM license content resembles the following:

    3. Bootstrap the license file as described at the end of the following scripts: main and variables.
    4. Place the license.lic file in the same directory as the other Terraform definition files in your working directory so that the next step will parse and process it automatically.
    5. Run Terraform as described in Using Terraform to deploy a single FortiGate-VM.
    6. After deployment, log into the FortiGate by accessing https://<IP_address> in your browser. The system displays the dashboard instead of a license upload window, since the license is already activated.

      To see how bootstrapping went, check if the command was successfully run. Open the CLI console and enter diag debug cloudinit show.

      If the cloud-init was run successfully, the CLI shows Finish running script with no errors.