Getting Started
Get the Terraform Web UI running and configure AWS credentials.
Prerequisites
Before using the UI:
- Python 3.11+ installed
- Node.js 18+ installed
- AWS CLI installed and configured with at least one profile
- Repository cloned:
git clone https://github.com/FortinetCloudCSE/fortinet-ui-terraform.git cd fortinet-ui-terraform
Quick Start
First Time Setup
Run the setup script to install Python and Node.js dependencies:
cd ui
./SETUP.shStart the UI
Use the restart script to start both backend and frontend:
cd ui
./RESTART.shExpected output:
Restarting Terraform Configuration UI...
Cleaning up old processes...
Verifying backend...
Starting backend (FastAPI)...
Backend started (PID: 12345)
Waiting for backend to be ready...
Backend is healthy
Verifying frontend...
Starting frontend (Vite)...
Frontend started (PID: 12346)
Waiting for frontend to be ready...
Frontend is ready
============================================
Services started successfully!
============================================
URLs:
Frontend: http://localhost:3000
Backend: http://127.0.0.1:8000
API Docs: http://127.0.0.1:8000/docsOpen http://localhost:3000 in your browser.
AWS Credentials
The UI requires AWS credentials to discover resources (regions, availability zones, key pairs, VPCs, Transit Gateways). Without credentials, you’ll need to manually type these values.
SSO Users (Recommended)
Use the aws_login.sh script in the sso_login/ directory:
source sso_login/aws_login.sh [profile] [backend_url]Examples:
# Login with default profile (40netse) to default backend (http://127.0.0.1:8001)
source sso_login/aws_login.sh
# Login with specific profile
source sso_login/aws_login.sh my-aws-profile
# Login with specific profile and custom backend URL
source sso_login/aws_login.sh my-aws-profile http://localhost:8000The script:
- Authenticates via AWS SSO
- Exports credentials to your shell environment
- Sends credentials to the UI backend
Tip
Use source (not just ./) so credentials are exported to your current shell.
IAM Users (Static Credentials)
Use the aws_static_login.sh script for IAM users with access keys:
source sso_login/aws_static_login.sh [profile] [backend_url]Examples:
# Load default profile
source sso_login/aws_static_login.sh
# Load specific profile
source sso_login/aws_static_login.sh my-profileVerify Credentials
Check that credentials are working:
curl http://localhost:8000/api/aws/credentials/statusResponse:
{
"valid": true,
"account": "123456789012",
"arn": "arn:aws:iam::123456789012:user/example",
"source": "session",
"message": "AWS credentials are valid"
}Using the UI
The UI workflow consists of three steps:
1. Select Template
Choose a template from the dropdown:
- existing_vpc_resources - Base infrastructure (deploy first)
- autoscale_template - Elastic FortiGate cluster with GWLB
- ha_pair - Fixed Active-Passive FortiGate cluster
2. Configure
Fill out the form fields. The UI provides:
- Dynamic dropdowns - AWS regions, AZs, and key pairs populated from your account
- Field validation - Real-time validation prevents configuration errors
- Smart dependencies - Fields update automatically based on your selections
- Grouped sections - Related options organized into collapsible sections
3. Generate and Deploy
Click Generate to create the terraform.tfvars file, then either:
- Download - Save the file locally
- Save to Template - Write directly to the template directory
Docker Containers (Alternative)
Run the UI and Hugo documentation server in Docker containers instead of locally.
Start Containers
cd ui/docker-containers
docker-compose up -dServices
| Service | Port | URL |
|---|---|---|
| Frontend | 3001 | http://localhost:3001 |
| Backend | 8001 | http://localhost:8001 |
| Hugo Docs | 1313 | http://localhost:1313/fortinet-ui-terraform/ |
AWS Credentials for Containers
Send credentials to the containerized backend (note port 8001):
source sso_login/aws_login.sh my-profile http://localhost:8001Container Commands
# Start all services
docker-compose up -d
# Start only UI (no Hugo)
docker-compose up -d backend frontend
# View logs
docker-compose logs -f
# Stop all services
docker-compose down
# Rebuild after code changes
docker-compose up -d --buildTroubleshooting
Backend Won’t Start
Error: command not found: uv
Solution: Install uv package manager:
curl -LsSf https://astral.sh/uv/install.sh | shError: ModuleNotFoundError
Solution: Sync dependencies:
cd ui/backend
uv syncFrontend Won’t Start
Error: command not found: npm
Solution: Install Node.js from https://nodejs.org/
Error: Cannot find module
Solution: Install dependencies:
cd ui/frontend
npm installAWS Dropdowns Empty
Symptom: Region, AZ, and key pair dropdowns are empty or show errors.
Solutions:
Check credential status:
curl http://localhost:8000/api/aws/credentials/statusIf using SSO, ensure session is active:
source sso_login/aws_login.sh your-profileIf credentials expired, re-run the login script.
Next Steps
See Example Templates for step-by-step configuration guides for each template.