Configuring Redis Services with flightcontrol.json
Overview of Redis Service Type
This service will create a Redis instance using AWS Elasticache with AUTH and Encryption in transit (TLS) enabled by default.
The password and the connection URL(s) will be stored in the SSM Parameter Store in your AWS Account - Flightcontrol does not store it.
Besides the AWS Elasticache resource and the SSM Parameter, there are a couple of other AWS resources needed for the architecture which we abstract away, like Subnets and Security Group.
We’ll automatically add a NAT gateway in the VPC if it doesn’t exist. A NAT gateway costs about $32/month.
Redis Service Attributes
The type for all Redis services is redis
, and should be specified like the following:
type: 'redis'
Identifiers
id: string
- Example:
"id": "redis"
- This is a string id that you create. We use it on each git push to match your config to your existing service in AWS
- This cannot be changed. If you change it, it will create a new service.
name: string
- Example:
"name": "Redis"
- This is the name we use to display your service in the Flightcontrol web dashboard
Redis-Specific Options
The following attributes are specific to Redis services:
Target
target: string
- Example:
"target": "redis-cluster"
- Optional
- Specifies the target for the Redis service
Engine
engine: string
The cache engine to be created. Supported values: "redis"
- Example:
"engine": "redis"
instanceSize: string
- The AWS instance size
- Example:
"instanceSize": "cache.t4g.small"
- Support values: See the AWS documentation
- Changing this after creation will not currently work.
Engine Version
engineVersion: string
- Cannot be changed after initial deployment
- Supported values:
- Redis:
"7.1", "7.0", "6.2", "6.0", "5.0.6", "5.0.5", "5.0.4", "5.0.3", "5.0.0", "4.0.10", "3.2.10", "3.2.6", "3.2.4", "2.8.24", "2.8.23", "2.8.22", "2.8.21", "2.8.19", "2.8.6", "2.6.13"
- Redis:
- Default:
7.1
- Example:
"engineVersion": "6.2"
autoMinorVersionUpgrade: boolean
- Example:
"autoMinorVersionUpgrade": true
- Optional with default:
true
Port
port: int
- Example:
"port": 6379
- Optional with default:
- Redis:
6379
- Redis:
Apply Changes Immediately
applyChangesImmediately: boolean
- Optional with default:
false
- If set to
true
, changes will be applied immediately (with downtime) instead of during next maintenance window - Note: Not applicable at the moment for most changes
Number of Replicas
numberOfReplicas: number
- The number of replicas you want in your Redis service
- Optional with default:
1
Encryption at Rest
encryptionAtRest: boolean
- Example:
"encryptionAtRest": true
- Optional with default:
true
- Enable or disable encryption of Redis at rest.
Eviction Policy
evictionPolicy: string
- Optional with default:
"volatile-lru"
- Supported values:
"volatile-lru"
,"allkeys-lru"
,"volatile-lfu"
,"allkeys-lfu"
,"volatile-random"
,"allkeys-random"
,"volatile-ttl"
,"noeviction"
- The eviction policy for Redis when memory limits are reached
Connection String Environment Variable
connectionStringEnvVarName: string
- Example:
"connectionStringEnvVarName": "REDIS_URL"
- Optional
- Must only contain word characters (letters, numbers, or underscore)
- Specifies the name of the environment variable to inject in sibling services with the redis connection string
- Recommended to not set this when using config as code, and instead use
fromService
inenvironmentVariables
Limitations for the Redis Service Type
We do not currently support:
-
Changing the cluster configuration after creation, i.e.: the engine version or the instance size. This means if you need to make changes after deployment, you will need to delete the service and add a new one with a different ID.
-
AWS Cluster Mode, which includes sharding and multiple clusters under the same service