An example to showcase how to connect a function to a Scaleway Redis cluster with TLS enabled.
At 8:00 AM every day, the function retrieves the hourly temperature in Paris and outputs it to a Redis store.
The Redis certificate is provided via a secret to the function and then written to a file.
This example requires Terraform.
Everything is managed with Terraform. The terraform config files will also create a Redis cluster, so be sure to remove it from the configuration if you do not need one.
terraform init
terraform apply
You should be able to see your function in the Scaleway console.
To check the results:
- Get the Redis connection string from the console
- Connect with
redis-cli
:
# From a Scaleway instance (if acl enabled)
redis-cli -h <cluster_ip> --user <my_user> --askpass --tls --cacert serverless-weather-redis-example.pem