Implement Serverless Valkey cache with IAM authentication for MITxOnline #3584
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.
This PR implements a complete Serverless Valkey cache solution for MITxOnline as a Redis replacement, addressing the transition requirements outlined in issue #3562.
Key Changes
New ServerlessCache Component
OLAmazonServerlessCache
component with full IAM authentication supportMITxOnline Integration
mitxonline-app-{env_suffix}
) with full access permissionsmitxonline-usergroup-{env_suffix}
) for proper authenticationConnect
,DescribeServerlessCaches
,DescribeUsers
,DescribeUserGroups
Authentication Architecture
The implementation addresses the IAM authentication requirements mentioned in the issue comments:
Exports and Integration Points
Added comprehensive exports for application configuration:
serverless_cache_endpoint
- Primary write endpoint for applicationsserverless_cache_reader_endpoint
- Read replica endpoint for read operationsserverless_cache_arn
- Full ARN for resource references and policiesserverless_cache_user_id
/serverless_cache_user_group_id
- IAM authentication credentialsTesting
OLAmazonServerlessCacheConfig
validationTechnical Implementation Details
The serverless cache configuration handles AWS-specific constraints:
subnet_ids[:3]
due to AWS 3-subnet maximum for serverless cachesThis implementation provides the foundation for transitioning MITxOnline from traditional Redis to Serverless Valkey while maintaining the existing infrastructure during the migration period.
Fixes #3562.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.