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:
- See Deployment of a single FortiGate-VM on the Oracle Cloud Infrastructure (OCI).
- Bootstrap the FortiGate-VM at initial bootup:
- 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
- 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:
- Bootstrap the license file as described at the end of the following scripts: main and variables.
- 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.
- Run Terraform as described in Using Terraform to deploy a single FortiGate-VM.
- 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.
- Replace the following lines in config.conf with your own FortiOS CLI commands: