List all the unattached IP addresses in Azure, AWS, GCP

Cloud providers charge for reserved IP addresses even when they’re not attached to resources. These “orphaned” IPs can accumulate significant costs over time, especially in large environments where they’re forgotten after resources are decommissioned.

You can run a CloudQuery sync with AWS, Azure, and/or GCP plugin and then list all the unattached IP addresses with this PostgreSQL query:

SELECT 'aws' as cloud, account_id, tags->>'Name' as name, tags 
FROM aws_ec2_eips 
WHERE association_id IS NULL

UNION ALL

SELECT 'gcp' as cloud, project_id as account_id, name, labels as tags 
FROM gcp_compute_addresses 
WHERE status = 'RESERVED'

UNION ALL

SELECT 'azure' as cloud, subscription_id as account_id, name, tags 
FROM azure_network_interfaces 
WHERE NOT (properties ? 'virtualMachine')