Skip to content
All projects

Com2us Platform · FinOps

Dragon Sky FinOps: 62% lower infrastructure cost

Linked revenue metrics with infrastructure cost and found unused resources automatically every day with Python, cutting infrastructure cost by up to 62%.

Role
Cloud Engineer · Main engineer
Period
Feb 2023 – Feb 2026
Cloud
Azure
Scale
10 servers · 5 databases
Key tech
Azure · Python · Billing monitoring
- 62 %
Maximum infrastructure cost reduction
10
Servers
5
Databases

At a glance

TimeRevenueInfrastructure costRevenue and cost monitored togetherUnused resources flaggedUp to -62%
Infrastructure cost fell by up to 62%.

Problem

Infrastructure cost was high relative to game revenue, which hurt profitability.

Approach

Revenue metrics and infrastructure cost were monitored together. Python found unused resources across every cloud automatically each day.

Result

Infrastructure cost fell by up to 62%.

Up close

Runs every dayPythonResources on every cloudUnused resources to clean up
The result becomes a cleanup list that stops cost leaks.

What this code does: Walks through each AWS account and region looking for unused resources. A public IP counts as unused when it is attached to no instance and has no association, and its name, allocation ID, and IP are recorded together. For security groups, names matching the exclusion rules are skipped, and the rest are checked for any network interface that uses them. The results pile up in one common shape (UnusedResource), so cleanup candidates can be read from a single list.

    for account, region, client in provider.regional("ec2"):
        base = {"cloud": "AWS", "project": account.name, "project_id": account.account_id, "region": region}
        for address in client.describe_addresses()["Addresses"]:
            if not address.get("InstanceId") and not address.get("AssociationId"):
                label = (
                    f"{_name(address)} ({address.get('AllocationId')} / {address.get('PublicIp')})".strip()
                )
                records.append(UnusedResource(resource_type="IP", resource=label, **base))
        for group in client.describe_security_groups()["SecurityGroups"]:
            if _excluded(group["GroupName"], rules):
                continue
            used = client.describe_network_interfaces(
                Filters=[{"Name": "group-id", "Values": [group["GroupId"]]}]
            )["NetworkInterfaces"]
            if not used:

What I learned

I learned that cost is easier to judge against revenue than as an amount on its own. Putting infrastructure cost next to revenue metrics made it clear which resources affect profitability and what to cut first. Cost leaks also do not end after one cleanup, so detecting unused resources every day in Python, instead of someone looking now and then, was what kept the savings in place. Detection alone saves nothing until resources are actually removed, which showed me that the next step in cost management is a flow that takes each finding quickly to cleanup approval and action.

Open to work · Cloud infrastructure and security

Choose a theme

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

Back to the front page →