Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serverless AWS ElastiCache not working because it needs TLS #580

Open
pblackwood opened this issue Feb 19, 2025 · 0 comments
Open

Serverless AWS ElastiCache not working because it needs TLS #580

pblackwood opened this issue Feb 19, 2025 · 0 comments

Comments

@pblackwood
Copy link

You guys are awesome
First of all, thank you Dan et al for building a wonderful tool for the Rails community.

Describe the bug
I have configured my rails 6.1 app with coverband and it works fine in localhost talking to Redis in a local docker container.
Our app deploys to AWS ECS in staging and production. For staging (the first one I tried), it works to create a single-node clustered ElastiCache with what AWS calls Redis OSS. In the Rails environment we set REDIS_URL to be redis://elasticache-endpoint:6379.

To make it work the option Transit encryption mode needs to be set to Preferred instead of the default Required. This means that TLS from the client side (the Rails/Coverband side) is optional. When it is set to Required coverband can't send data to Redis. The error message in the server logs is

coverage failed to store
Coverband Error: #<Redis::TimeoutError: Waited 1.0 seconds> Waited 1.0 seconds

So I'm convinced that the default transport security from coverband is none. Is it possible to configure it to use TLS from the containing Rails app? Or would it require a code change to the gem? I realize this is not a bug in coverband but other people may have also run into this.

What we really want to do is create the Redis cache as a serverless ElastiCache, but serverless does not offer the option Transit encryption mode. It is always Required.

To Reproduce
Steps to reproduce the behavior:

  1. Create a serverless ElastiCache instead of the single-node cluster described above
  2. Include an environment variable REDIS_URL with value redis://elasticache-endpoint:6379
  3. Start the app with coverband enabled
  4. See error in the logs

Expected behavior
I can create a serverless ElastiCache for Redis on AWS and provide coverband with REDIS_URL (with additional TLS config on the coverband side) and coverage works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant