I have a setup with an egress VPC and a Transit Gateway (TGW) in a TGW account. Spoke VPCs send their data to the TGW. When an account sends data to the TGW, it's billed to the source account.
The following query on my TGW flow logs provides me with the top 10 accounts that send data to the TGW. Is this query correct? When I compare the "eu-tgw-gb" value with the EU-TransitGateway-Bytes in Cost Explorer in the source account, it almost always matches. However, I have an account where this value is 650GB according to the TGW Flow logs, but Cost Explorer reports it as 770GB. I don't understand this difference. I checked the same account on other days, and there were also discrepancies. So, it doesn't seem like I am missing flow data, but how can this discrepancy be explained?
select
tgw_src_vpc_account_id,
cast(sum(bytes)/power(1024,3) as decimal(38,3)) as "eu-tgw-gb" /*To convert per account bytes to GB*/
FROM "default"."tgwflowlogs"
WHERE day >= '2024/05/23' AND day <= '2024/05/23' AND "log_status" = 'OK' AND flow_direction = 'ingress'
GROUP BY 1 ORDER BY "eu-tgw-gb" DESC LIMIT 10;
Thanks