feat(#225): wire live NAT Gateway pricing (Infracost EC2 → stored under VPC) - #229
Merged
Conversation
…er VPC) NAT Gateway had no live descriptor — it was commented out as "TBD" because it isn't under a standard AmazonVPC productFamily. It is priced under service AmazonEC2 / productFamily "NAT Gateway" (operation=NatGateway, distinguishing it from RegionalNatGateway), but the handler and seed model it under AmazonVPC. Two small, general descriptor capabilities support this: - store_service: upsert fetched rows under a different catalog service than the one queried (AmazonEC2 → AmazonVPC), so the engine/handler query finds them. - usagetype_exclude: drop sibling usagetypes sharing the metric's unit — here the $0 "Prvd" (provisioned-throughput) GB row that would otherwise dilute the data-processed rate. Descriptors added: - NAT-Gateway-Hour AmazonEC2/"NAT Gateway", op=NatGateway, Hrs → AmazonVPC - NAT-Gateway-DataProcessed same, GB, exclude "Prvd" → AmazonVPC Live end-to-end (real cache+catalog): 730h = $32.85, 100GB = $4.50, _nat_cost(730,100) = $37.35 — all under AmazonVPC, matching the handler's query. Tests (HTTP mocked): descriptor presence, service remap AmazonEC2→AmazonVPC, and the Prvd-row exclusion for data-processed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
elecnix
marked this pull request as ready for review
July 3, 2026 17:00
This was referenced Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #225. NAT Gateway had no live Infracost descriptor — it was commented out as "TBD" because it isn't under a standard
AmazonVPCproductFamily. It's actually priced underAmazonEC2/ "NAT Gateway" (operation=NatGateway, distinguishing it fromRegionalNatGateway), while the handler and seed model it underAmazonVPC.Two small, general descriptor capabilities
store_service— upsert fetched rows under a different catalog service than the one queried (AmazonEC2→AmazonVPC), so the engine/handler query finds them.usagetype_exclude— drop sibling usagetypes that share the metric's unit. Here NAT Gateway's data-processed GB unit is shared by a$0NatGateway-Prvd-Bytes(provisioned-throughput) row that would otherwise dilute the rate.Descriptors
NAT-Gateway-HourAmazonEC2/"NAT Gateway",op=NatGateway,HrsAmazonVPCNAT-Gateway-DataProcessedGB, excludePrvdAmazonVPCLive end-to-end validation (real cache + catalog)
AmazonVPC._nat_cost(730, 100)= $37.35, matching the handler's existing expectation.NatGateway-Hours,EU-NatGateway-Hours,APS3-NatGateway-Hours— theAPS3for ap-south-1 also confirms the fix: correct ap-southeast-3 usagetype prefix; drop duplicate registry/seed rows #221 prefix fix).Test plan (HTTP mocked)
AmazonEC2→AmazonVPC.Prvdrow exclusion for data-processed.