1 Answer
- Newest
- Most votes
- Most comments
2
Hello,
as per node-redis source code , the error is thrown when ParseURL()
finds an invalid configuration:
if (protocol === 'rediss:') {
(parsed.socket as RedisTlsSocketOptions).tls = true;
} else if (protocol !== 'redis:') {
throw new TypeError('Invalid protocol');
}
I could not find "host" as a valid parameter for CreateCluster().rootNodes configuration.
You probably want to replace host
by url
and make sure that process.env.redis_endpoint
expands to a valid URL like:
redis[s]://[[username][:password]@][host][:port][/db-number]
Example:
- no in-transit encryption
const client = createCluster({
rootNodes: [
{
url: 'redis://Elasticache_Cluster_Endpoint_here:6379'
}
]
});
- in-transit encryption without authentication:
const client = createCluster({
rootNodes: [
{
url: 'rediss://Elasticache_Cluster_Endpoint_here:6379'
}
]
});
- in-transit encryption and RBAC/ACL authentication:
const client = createCluster({
rootNodes: [
{
url: 'rediss://user_name:password@Elasticache_Cluster_Endpoint_here:6379'
}
]
});
Relevant content
- Accepted Answerasked 3 years ago
- asked 3 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago