Skip to content

VED-1163: Elasticache Security Configurations#1451

Open
Thomas-Boyle wants to merge 3 commits intomasterfrom
ved-1163-elasticache-security-config
Open

VED-1163: Elasticache Security Configurations#1451
Thomas-Boyle wants to merge 3 commits intomasterfrom
ved-1163-elasticache-security-config

Conversation

@Thomas-Boyle
Copy link
Copy Markdown
Contributor

@Thomas-Boyle Thomas-Boyle commented Apr 29, 2026

PR Description

Added Redis authentication support using AWS Secrets Manager.

  • Created a new Redis replication group alongside the existing Redis cluster to support a staged consumer migration.
  • Generated the Redis auth token through Secrets Manager via CloudFormation dynamic references.
  • Updated Lambda environment variables to use the new Redis endpoint and auth token secret name.
  • Enhanced the Redis client to retrieve the auth token from Secrets Manager.
  • Scoped Redis secret access to Redis-consuming workloads only.
  • Preserved the existing Redis cluster so it can remain available until consumers have been migrated and the old cache can be safely removed.

How were the changes tested

Screenshots to be provided

- Added support for Redis authentication using AWS Secrets Manager.
- Introduced a new `random_password` resource for generating Redis auth tokens.
- Updated the `aws_elasticache_replication_group` to include authentication settings.
- Modified environment variables in Lambda functions to include Redis connection details and auth token.
- Enhanced the Redis client to retrieve the auth token from Secrets Manager.
- Updated IAM policies to allow access to the Redis auth token.

This change improves security by managing Redis credentials through AWS Secrets Manager.
@github-actions
Copy link
Copy Markdown
Contributor

This branch is working on a ticket in the NHS England VED JIRA Project. Here's a handy link to the ticket:

VED-1163

Comment thread infrastructure/account/redis_cache.tf Outdated
Comment thread infrastructure/instance/policies/secret_manager.json Outdated
Comment thread infrastructure/account/redis_cache.tf Outdated
Copy link
Copy Markdown
Contributor

@avshetty1980 avshetty1980 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we create a new replication group, repopulate it, bring over the consumers and only then remove the old cluster?
Have a dedicated Redis secret policy only to the redis consumer?
Then there are some small nits.

Thomas-Boyle and others added 2 commits May 1, 2026 11:24
- Introduced a new local variable for the Redis replication group ID to enhance maintainability.
- Updated CloudWatch dashboard metrics to reference the new Redis cluster ID variable.
- Removed unused random password resource and Secrets Manager secret for Redis authentication.
- Replaced the ElastiCache replication group resource with a cluster resource for simplified configuration.
- Added a CloudFormation stack to manage Redis replication group and its authentication token securely.

These changes streamline the Redis setup and improve the security of authentication management.
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This PR contains a fix for existing functionality. terraform Pull requests that update terraform code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants