3 Answers
- Newest
- Most votes
- Most comments
0
I'm using a connectionstring in this format:
export const redisClient1 = new Redis(
"redis://user-name:password@end-point:6379"
);
answered 3 months ago
0
Can you paste your connect strings here?
Note that you must connect using TLS when accessing ElastiCache Serverless.
answered 3 months ago
0
Couple of things to consider:
- Using TLS: Make sure your client connection is using TLS when connecting to the ElastiCache Serverless endpoint. Encryption in transit is always on for ElastiCache Serverless caches, and you must use TLS when connecting to it.
- VPC: Ensure that the EC2 instance from where you are connecting to the cache is in the same VPC as the cache. In this case, it looks like you are using the default VPC to create your serverless cache; make sure that your EC2 instance is also in the same VPC.
- Security groups: ElastiCache uses security groups to control access to your cache. Consider the following:
- Make sure that the security group used by your ElastiCache cache allows inbound access from your EC2 instance. See https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html to learn how to setup inbound rules in your security group correctly.
- Make sure that the security group used by your ElastiCache cache allows access to the 6379 and 6380 ports. ElastiCache uses these ports to accept Redis commands. Learn more about how to setup port access: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/set-up.html#elasticache-install-grant-access-VPN.
- Looks like you are trying to connect to the cache using a specific user/password and looks like you have modified the serverless cache to use the user-group that has your user in it. Consider the following code snippet for creating a connection using Redis Auth - Note TLS must be enabled.
const redisClient = new Redis({
port: 6379, // Redis port
host: redisHost, // Serverless cache endpoint
username: redisUser, // Redis username
password: redisPassword, // Redis password
tls: {} // Enable TLS.
});
Another check you could run to eliminate any networking connectivity issues is to connect using the redis-cli. Use the following command to try connecting from the CLI:
redis-cli -h your-cache endpoint -p 6379 --tls -a 'yourpassword' --user youruser
Can you confirm if you are able to connect to your cache from your EC2 instance using the redis-cli command above?
answered 3 months ago
Relevant content
- asked 4 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago
try changing it to "rediss://" with two s, to use SSL/TLS
Ok tried that as well but still no luck. Just to confirm, I created a user and a user group and then modified my serverless instance to use that "user group" to control access, and in the connectionstring i'm specifiying the user and password that I created. That's the recommended way to access? Thanks!