Skip to content

chore: deprecate and remove aws-sdk-go-cache dependency #525

@tekenstam

Description

@tekenstam

Summary

keikoproj/aws-sdk-go-cache should be deprecated and removed from all consumer repos. This issue tracks the deprecation rationale and cross-repo coordination. The actual removal in instance-manager is part of the AWS SDK v2 migration (#523).

Background

aws-sdk-go-cache is a response-caching layer for AWS SDK for Go v1 that caches read-only API calls (Describe*, List*, Get*) in-memory. It was originally built to mitigate AWS API rate limiting (throttling).

Why Remove It

  1. AWS SDK v1 is EOL — the library is built entirely on v1 request handlers with no v2 equivalent
  2. Rate limiting is no longer a practical issue — throttling hasn't been observed in keikoproj deployments in a long time
  3. AWS SDK v2 has robust built-in retry — standard retry mode includes token-bucket rate limiting (500 tokens), exponential backoff with jitter, configurable max attempts; adaptive retry mode adds dynamic client-side rate adjustment
  4. Maintenance burden — porting to v2 SDK middleware would be a significant rewrite for a problem that doesn't exist
  5. Short TTLs provide marginal benefit — most cached operations use 60s TTLs; built-in retry handles transient throttling equally well
  6. Complexity cost — TTL tuning, invalidation bugs, stale data risks

Consumer Repos

Repo Cached Operations Most Aggressive TTL Tracking Issue
instance-manager 16 ops (EC2, ASG, IAM, EKS, SSM) 24h (`DescribeInstanceTypes`) This issue + #523
upgrade-manager 2 ops (ASG, EC2) 60s keikoproj/upgrade-manager#544
lifecycle-manager 6 ops (ELB, ELBv2) 300s keikoproj/lifecycle-manager#271

Migration Path

Remove the dependency as part of the AWS SDK v2 migration (#523):

  • Replace `cache.NewSession()` / `cache.NewCacheConfig()` with standard `config.LoadDefaultConfig(ctx)`
  • AWS SDK v2 standard retry mode is the default — no extra code needed
  • For `DescribeInstanceTypes` (24h cache — truly stable data), add a simple `sync.Once` (~10 lines) instead of maintaining an entire caching library
  • Remove Prometheus cache metrics (`aws_api_cache_activity`, `aws_api_cache_flushes`); replace with v2 middleware if observability of API call volume is desired

After All Consumers Are Migrated

  • Update `aws-sdk-go-cache` README to indicate deprecation
  • Archive the `keikoproj/aws-sdk-go-cache` repository on GitHub (issues are already disabled)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions