From a70068ac93849b7a6dff0ead020b252f2ebd9bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesus=20Nu=C3=B1ez?= Date: Sat, 9 May 2026 18:32:38 -0400 Subject: [PATCH] chore: remove probe-pricing utility and Terraform e2e test configuration --- cmd/probe-pricing/main.go | 80 --------------------------------------- e2e-test/main.tf | 28 -------------- 2 files changed, 108 deletions(-) delete mode 100644 cmd/probe-pricing/main.go delete mode 100644 e2e-test/main.tf diff --git a/cmd/probe-pricing/main.go b/cmd/probe-pricing/main.go deleted file mode 100644 index 0f4fd00..0000000 --- a/cmd/probe-pricing/main.go +++ /dev/null @@ -1,80 +0,0 @@ -// Command probe-pricing inspects raw AWS Pricing API responses for a given -// service code and filter set. It exists for two reasons: -// -// 1. Diagnosing "multiple products" warnings: when an EstimateXxx mapper -// warns that a query returned >1 product, run the same filters through -// the probe to see exactly which attributes differ between the products -// and pick a tighter filter to add. -// 2. Ad-hoc exploration of new resource types before writing a mapper — -// dumping a known-good filter set is the fastest way to learn the -// attribute vocabulary AWS uses for that productFamily. -// -// Usage: -// -// go run ./cmd/probe-pricing '' -// -// Example: -// -// go run ./cmd/probe-pricing AmazonRDS \ -// '{"productFamily":"Database Storage","volumeType":"General Purpose","deploymentOption":"Single-AZ","regionCode":"us-east-2"}' -// -// Requires AWS credentials in the standard chain (env vars, shared config, -// instance metadata). The Pricing API endpoint is forced to us-east-1 by -// pricing.NewClient regardless of the resource's region — the resource -// region is a filter value, not the endpoint region. -package main - -import ( - "context" - "encoding/json" - "fmt" - "log" - "os" - "sort" - - "CloudOracle/internal/pricing" -) - -func main() { - if len(os.Args) < 3 { - log.Fatal("usage: probe-pricing ") - } - - var filters map[string]string - if err := json.Unmarshal([]byte(os.Args[2]), &filters); err != nil { - log.Fatalf("invalid filters JSON: %v", err) - } - - ctx := context.Background() - client, err := pricing.NewClient(ctx) - if err != nil { - log.Fatalf("NewClient: %v", err) - } - - products, err := client.GetProducts(ctx, os.Args[1], filters) - if err != nil { - log.Fatalf("GetProducts: %v", err) - } - - fmt.Printf("Got %d products for %s with filters %v\n\n", len(products), os.Args[1], filters) - for i, p := range products { - var parsed map[string]interface{} - if err := json.Unmarshal([]byte(p), &parsed); err != nil { - fmt.Printf("[%d] parse error: %v\n", i, err) - continue - } - product, _ := parsed["product"].(map[string]interface{}) - attrs, _ := product["attributes"].(map[string]interface{}) - - fmt.Printf("[%d] sku=%v\n", i, product["sku"]) - keys := make([]string, 0, len(attrs)) - for k := range attrs { - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - fmt.Printf(" %-30s = %v\n", k, attrs[k]) - } - fmt.Println() - } -} diff --git a/e2e-test/main.tf b/e2e-test/main.tf deleted file mode 100644 index 0918b45..0000000 --- a/e2e-test/main.tf +++ /dev/null @@ -1,28 +0,0 @@ -terraform { - required_version = ">= 1.5" - required_providers { - aws = { - source = "hashicorp/aws" - version = "~> 5.0" - } - } -} - -provider "aws" { - region = "us-east-2" -} - -# Single t3.micro on Linux on-demand — a small but non-zero cost diff -# (~$7-8/month) so the rendered comment exercises the Top-movers table -# and the LLM narrative path. The AMI is a well-known Amazon Linux 2 -# image in us-east-2; terraform plan does not resolve it (no data -# sources), so the value flows straight into the plan JSON for the -# CloudOracle parser to read. -resource "aws_instance" "self_test" { - ami = "ami-0c55b159cbfafe1f0" - instance_type = "t3.micro" - - tags = { - Name = "cloudoracle-self-test" - } -}