skip to Main Content

Currently I have several redis clusters for different env. In my code, I will write data to redis inside my lambda function, if I deploy this lambda to my aws account, how can it update the corresponding redis cluster? Since every environment has its own redis cluster.

enter image description here

enter image description here

2

Answers


  1. You can have a config file with Redis cluster name and their hostnames and in code, you can pick different clusters based on the env provided.

    If you are using roles in the AWS account, for each environment then you should also do STS on requirred role

    Login or Signup to reply.
  2. Your resource files are just files. They will be loaded by your application following different strategies, depend on your application’s framework and how it has been configured.

    Some application, at build-time, apply the correct configuration, by passing a flag to the build for example. --uat or --prod. If your application is one of those kind, you can just build the correct version and push it to AWS. They will connect to the correct Redis, given that you put the redis configuration into the ENV files

    The other option is to use Environment Variable
    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search