Discovered while reviewing #1207 (ARCH-04 fail-loud on unrecognized RI terms). getDurationValue at providers/aws/services/ec2/client.go:630 still returns OneYearSeconds for any unrecognized term with no error -- the same silent-fallback pattern #1207 fixed for RDS/ElastiCache/MemoryDB/OpenSearch/Redshift. EC2 was not in #1192's scope so it was correctly left out of #1207.
Fix: change getDurationValue to return (int64, error), error on unrecognized terms, and propagate from buildEC2QueryFromRec. Add a regression test asserting the error on a DB-null/garbage term.
Discovered while reviewing #1207 (ARCH-04 fail-loud on unrecognized RI terms).
getDurationValueatproviders/aws/services/ec2/client.go:630still returnsOneYearSecondsfor any unrecognized term with no error -- the same silent-fallback pattern #1207 fixed for RDS/ElastiCache/MemoryDB/OpenSearch/Redshift. EC2 was not in #1192's scope so it was correctly left out of #1207.Fix: change
getDurationValueto return(int64, error), error on unrecognized terms, and propagate frombuildEC2QueryFromRec. Add a regression test asserting the error on a DB-null/garbage term.