> For the complete documentation index, see [llms.txt](https://docs.decisionrules.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decisionrules.io/doc/other-deployment-options/docker-and-on-premise/setup/aws/cache-amazon-elasticache.md).

# Cache - Amazon ElastiCache

Here, you can find a tutorial on how to setup a Redis Elasticache to work with DecisionRules.

## Creating a Redis based Amazon ElastiCache

{% hint style="warning" %}
**AWS ElastiCache Serverless is not supported.** Please use an instance-based ElastiCache configuration instead.
{% endhint %}

Open ElastiCache Dashboard In the AWS Console, select ElastiCache. Hit **Get started** and select **Redis.** Click **Design your own cache** and select the **Cluster cache** method. Cluster mode **Disabled**.

Choose a name for your cluster and continue to Cluster settings. There, keep everything default apart from the Node type where I recommend you choose **cluster.t4g.micro.**

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FdkndsPrej0jZj3UhMMj3%2Fimage.png?alt=media&amp;token=be3bbf21-3c77-47c5-bb14-e70075348135" alt=""><figcaption></figcaption></figure>

Next in Connectivity choose Create a new subnet group, give it a name and choose your VPC.

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FwzV0jAaIgNddN2y8VZc6%2Fimage.png?alt=media&amp;token=222b8f0f-e7cc-4cff-825c-b5acabb2f42a" alt=""><figcaption></figcaption></figure>

Next up the Advanced settings.

Assign the cache your preffered security groups, for the purposes of this tutorial I only use the default one.

I choose to disable automatic backups as DecisionRules uses Redis only for caching and not as operational storage.

Keep the rest of the settings default and hit **Next.** Review the settings and **Create.**

## Necessary settings and connection strings

#### Maxmemory policy

Navigate to **ElastiCache / Configurations / Parameter groups**. Click **Create parameter group**. Here assign the parameter group a name and for the **Family** setting choose **redis7.** Hit **Create.**

Go to the newly created parameter group and click **Edit parameter values.** Search for **maxmemory-policy**. For the value of this policy select either **allkeys-lfu or allkeys-lru.** Hit **Save changes.**

<figure><img src="https://437457296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MN4F4-qybg8XDATvios%2Fuploads%2FdMIGJ8X7WwrEhdDDuBDf%2Fimage.png?alt=media&amp;token=7e03f6a4-9fed-4b4c-b9be-f7a3663299a7" alt=""><figcaption></figcaption></figure>

#### Connection string

To find your connection string navigate to your redis ElastiCache and there under **Cluster details** look for **Primary endpoint.**

The **connection string** will have the following format: `redis://<primary_endpoint>`

**For ease-of-use below are the necessary settings in list form:**

* **Engine**: Redis
* **Engine version**: 6 and newer
* **Port**: 6379
* **Number of replicas**: 2
* **Multi-AZ**: Yes
* **Advanced Redis settings:**
  * **Subnet group**: Same as DecisionRules server app
  * **Availability zones placement**: No preference
* **Security:**
  * **Security groups**: Same as DecisionRules server app
  * **Encryption at-rest**: No
  * **Encryption in-transit**: No


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decisionrules.io/doc/other-deployment-options/docker-and-on-premise/setup/aws/cache-amazon-elasticache.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
