Created
March 15, 2022 07:46
-
-
Save guitarrapc/365071dbd6b974ac6fda700a83a88037 to your computer and use it in GitHub Desktop.
Connect redis-cli in Docker to TLS Encypted ElastiCache Redis Cluster.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run on host... | |
docker run -it --entrypoint /bin/bash redis | |
# run inside docker... | |
apt-get update | |
apt-get install -y stunnel net-tools | |
cat <<EOF > /etc/stunnel/redis-cli.conf | |
fips = no | |
setuid = root | |
setgid = root | |
pid = /var/run/stunnel.pid | |
debug = 7 | |
delay = yes | |
options = NO_SSLv2 | |
options = NO_SSLv3 | |
[redis-cli] | |
client = yes | |
accept = 127.0.0.1:6380 | |
connect = <ElastiCache-ConfigurationEndpoint> | |
EOF | |
stunnel /etc/stunnel/redis-cli.conf | |
netstat -tulnp | grep -i stunnel | |
redis-cli -c --cluster-only-masters -h localhost -p 6380 -a 'PASS' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref