KMS-645: Enable API Gateway response caching and access logging for KMS read endpoints, with cache settings controlled via environment variables.#91
Conversation
added 14 commits
January 21, 2026 18:27
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #91 +/- ##
=======================================
Coverage 99.59% 99.59%
=======================================
Files 143 143
Lines 2478 2478
Branches 608 608
=======================================
Hits 2468 2468
Misses 9 9
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
htranho
approved these changes
Jan 27, 2026
added 24 commits
January 30, 2026 16:30
… API Gateway methods (including CORS OPTIONS) and their integrations exist
… API Gateway Methods (including CORS OPTIONS) and their Lambda integrations exist
… (ignore ResourceAlreadyExistsException)
eudoroolivares2016
approved these changes
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
What is the feature?
Enable API Gateway response caching and access logging for KMS read endpoints, with cache settings controlled via environment variables.
What is the Solution?
Solution?
• Add API Gateway stage cache configuration (TTL, cluster size, enabled flag) and apply caching method options for selected GET routes.
• Add API Gateway access logs to a dedicated CloudWatch Log Group (disabled when running against LocalStack).
• Introduce helper utilities to centralize cache method options and to patch method/integration settings for cache keys/query params.
• Wire new env vars into the CDK app defaults.
What areas of the application does this impact?
• CDK infrastructure: KmsStack.ts
• API Gateway stage configuration (cache + logs)
• Read endpoints under /concepts (GET routes listed in ApiCacheSetup.cacheMethodOptions)
• Deployment configuration via new env vars in main.ts
Testing
Accessing API Gateway Logs:
To verify that caching is working correctly:
Monitor CloudWatch logs for the /concepts endpoint.
Test caching behavior:
a. Make an initial request to /concepts.
b. Repeat the same request within 1 hour.
c. Check CloudWatch logs to confirm the Lambda function is not invoked on the second request.
Verify cache configuration:
Test with variations:
After 1 hour, verify that the cache expires and a new Lambda invocation occurs.
Remember: The absence of a Lambda invocation log for repeated requests within the cache period indicates successful caching.
Attachments
Please include relevant screenshots or files that would be helpful in reviewing and verifying this change.
Checklist