perf(aws): populate ComputeDetails VCPU/MemoryGB from EC2 DescribeInstanceTypes catalogue · Issue #99 · LeanerCloud/cloud-commitments-cli · GitHub
Skip to content

perf(aws): populate ComputeDetails VCPU/MemoryGB from EC2 DescribeInstanceTypes catalogue #99

Closed

Description

@cristim

Summary

PR #97 extended common.ComputeDetails with VCPU + MemoryGB fields. The AWS compute path (providers/aws/recommendations/parser_services.go::ec2Info) doesn't populate them because the upstream Cost Explorer EC2InstanceDetails doesn't carry that data — populating requires a new ec2.DescribeInstanceTypes caller + per-region cache + mocks for tests.

Current behaviour

parser_services.go:76 builds &common.ComputeDetails{} from CE data only. The new VCPU / MemoryGB fields ship as zero (omitted from JSON via omitempty).

Steps to verify the gap

Query a deployed environment with AWS EC2 RI recommendations and observe that responses have details.vcpu / details.memory_gb absent.

Expected behaviour

Populated from ec2.DescribeInstanceTypes(InstanceTypes: [m5.large, ...]) keyed by the converter's seen instance types. Cache the catalogue per-region for the duration of a recommendation collection.

Proposed fix

  1. Add an EC2 instance-type catalogue caller in providers/aws/services/ec2/ — wraps DescribeInstanceTypes, caches per-region per-collection-run.
  2. Inject the catalogue into parser_services.go (or the equivalent post-fetch enrichment point).
  3. Populate VCPU from InstanceTypeInfo.VCpuInfo.DefaultVCpus, MemoryGB from InstanceTypeInfo.MemoryInfo.SizeInMiB / 1024.
  4. New mocks in test files for the new SDK call.

References

Severity

Low — same as Azure side; UI degrades to "unknown".

Effort

Medium — net-new SDK caller + per-region cache + per-collection lifecycle + mocks. Larger than the Azure follow-up.

Activity

  1. cristim commented on Apr 28, 2026

    @cristim
    MemberAuthor

    P3 — graceful degradation to 'unknown' in the UI, low urgency. EC2 VCPU/MemoryGB population requires a new DescribeInstanceTypes caller + per-region cache, making this effort/m. Not blocking any shipped feature; defer to after the override cluster (#107, #111) is resolved. (triage agent wave1-B)

  2. cristim commented on May 28, 2026

    @cristim
    MemberAuthor

    Verification: cannot-verify-autopilot

    PR #229 (merge commit c05c0d1, confirmed in origin/feat/multicloud-web-frontend) closes #148 (Azure compute vCPU/MemoryGB via cached SKU catalogue), not #99. Issue #99 is specifically about the AWS path: providers/aws/recommendations/parser_services.go::ec2Info needs a new ec2.DescribeInstanceTypes caller + per-region cache + mocks to populate VCPU/MemoryGB. Verified on feat branch that providers/aws/recommendations/ has no DescribeInstanceTypes call. Issue remains open.

  3. added 4 commits that reference this issue on Jun 5, 2026
    8faa622
    2f17405
    867b4c6
    ac9fad7
  4. added a commit that references this issue on Jun 19, 2026
    a751026
  5. added 2 commits that reference this issue on Jul 5, 2026
    f7cb446
    fe2c696
  6. added a commit that references this issue on Jul 17, 2026
    63d1805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions