Upgrade FortiOS

Upgrading FortiOS on an Autoscale Group

The upgrade_fortios/ toolset upgrades a FortiGate autoscale group running in AWS. Two strategies are available, selected interactively at runtime based on the deployment’s current state and the operator’s risk tolerance.

Upgrade Strategies

StrategyBest ForTraffic ImpactRollback
In-PlaceSame-major-version bumps on healthy deploymentsBrief per-instance restartManual LT revert
Blue-GreenCross-major-version upgrades, config remediation, or when full fallback is requiredNear-zero (session interrupt at cutover)Single script call, < 60 seconds

In-Place Upgrade Paths

The in-place strategy inspects live ASG state and selects the appropriate path automatically:

PathConditionWhat Happens
Adesired = 0, no running instancesUpdate launch templates only — no instance replacement
Bdesired > 0, instances runningRolling replacement: secondaries first, primary last
Cdesired = 0 + config backup presentUpdate LTs, launch primary, restore config, scale out

Blue-Green Upgrade Phases

The blue-green strategy deploys a parallel inspection stack and flips TGW routes at cutover:

PhaseActionDuration
0 — DiscoveryExtract Blue inventory from terraform.tfstate30 min
1 — BackupExport primary FortiGate configuration30–60 min
2 — Deploy Greenterraform apply with new FortiOS AMI30–60 min
3 — Validate GreenHealth checks, config verification30–60 min
4 — CutoverAtomic TGW route flip + EIP migration5–10 min
5 — MonitorBlue suspended as fallback24–48 hours
6 — Cleanupterraform destroy Blue (irreversible)1–2 hours

Contents

Overview

Strategy selection guide, toolset architecture, and prerequisites.

In-Place Upgrade

Paths A, B, and C — step-by-step procedures for in-place FortiOS upgrades.

Blue-Green Upgrade

Phase-by-phase guide for parallel deployment with TGW route flip cutover.

Discovery

How discover.py extracts the Blue environment from Terraform state and the blue_inventory.json schema used by all subsequent phases.


Toolset Location

All upgrade scripts, documentation, and state files live under:

upgrade_fortios/
├── scripts/
│   ├── discover.py          — Extract Blue inventory from terraform.tfstate
│   ├── inplace_upgrade.py   — In-place upgrade workflow (Paths A, B, C)
│   ├── cutover.py           — TGW route flip + NAT GW EIP migration
│   ├── rollback.py          — Revert TGW routes to Blue + EIP rollback
│   └── watch_lambda.sh      — Stream Lambda CloudWatch logs during upgrade
├── state/                   — Working directory for tfstate files and backups
└── README.md