Skip to content
hannctl
PDF

case-studies summoners-war-arena-multicloud DESIGN.md

Summoners War: Sky Arena multi-cloud and firewall redesign Design and implementation

A massive game platform across GCP and Tencent Cloud, with 600 servers and 70 databases, a full firewall policy redesign, and patching with no maintenance window.

GCPTencent Cloud600 servers · 70 databases (across both clouds)WebGameDBAdmin
What remains is regrouped by server role, which makes rules easier to review and change.
Load balancerPatchingPatchingNo maintenance window: servers change one at a time
The whole pool is patched without stopping the service.

What this code does: Creates one GCP firewall rule for each entry in the rule map (var.rules) and uses the map key as the rule name. For INGRESS the ranges become sources, for EGRESS they become destinations, and use_service_accounts decides whether sources and targets are set by network tags or by service accounts. Because each rule is declared as a map entry rather than its own resource block, a policy grouped by role can be managed directly as data.

resource "google_compute_firewall" "rules" {
  for_each = var.rules

  network                 = each.value.network
  name                    = each.key
  direction               = each.value.direction
  source_ranges           = each.value.direction == "INGRESS" ? each.value.ranges : null
  destination_ranges      = each.value.direction == "EGRESS" ? each.value.ranges : null
  source_tags             = each.value.use_service_accounts || each.value.direction == "EGRESS" ? null : each.value.sources
  source_service_accounts = each.value.use_service_accounts && each.value.direction == "INGRESS" ? each.value.sources : null
  target_tags             = each.value.use_service_accounts ? null : each.value.targets
  target_service_accounts = each.value.use_service_accounts ? each.value.targets : null
  priority                = each.value.priority
© 2026 Kim JunHyun · Built with Astro · The infrastructure behind this site is code too

↑↓ move · Enter open · Esc close

Choose a theme

Click a badge to switch to that theme on the same content. Dragging only swings it.

Back to the front page →