You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(providers/aws): fail loud on unrecognized RI term in EC2 getDurationValue #1260
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.
Verification sweep against main (101f099fb) on 2026-07-27 finds this already resolved.
EC2's getDurationValue now fails loud on an unrecognized term rather than defaulting silently.
Evidence: commit c59c116.
Recommending close. This is the EC2 half of #1266; consider closing both together, or this one as a duplicate of #1266.
Verified resolved at 3c0f8ac: EC2's getDurationValue now returns (int64, error) and rejects any term other than 1yr/1/3yr/3 with an explicit unsupported-term error that the purchase query builder propagates before any API call. Evidence: providers/aws/services/ec2/client.go:672-679 and :464 (#1481). Residual axes checked: the duration defaults at client.go:787 and :865 apply to an unset numeric Duration filter on target-offering listing, not to a term string; the RDS/ElastiCache getDurationString variants are tracked separately in #1266. Closing as completed; reopen if the behaviour recurs.
Activity
cristim commentedon Jul 27, 2026
Verification sweep against
main(101f099fb) on 2026-07-27 finds this already resolved.EC2's getDurationValue now fails loud on an unrecognized term rather than defaulting silently.
Evidence: commit c59c116.
Recommending close. This is the EC2 half of #1266; consider closing both together, or this one as a duplicate of #1266.
cristim commentedon Sep 2, 2026
Verified resolved at 3c0f8ac: EC2's getDurationValue now returns (int64, error) and rejects any term other than 1yr/1/3yr/3 with an explicit unsupported-term error that the purchase query builder propagates before any API call. Evidence: providers/aws/services/ec2/client.go:672-679 and :464 (#1481). Residual axes checked: the duration defaults at client.go:787 and :865 apply to an unset numeric Duration filter on target-offering listing, not to a term string; the RDS/ElastiCache getDurationString variants are tracked separately in #1266. Closing as completed; reopen if the behaviour recurs.