NOTE: This repo contains only the documentation for the private BoltsOps Pro repo code. Original file: https://github.com/boltopspro/elasticache/blob/master/README.md The docs are publish so they are available for interested customers. For access to the source code, you must be a paying BoltOps Pro subscriber. If are interested, you can contact us at [email protected] or https://www.boltops.com
This blueprint provisions an ElastiCache cluster.
- It can provision either a Memcached or Redis cluster.
- By default, it provisions a Memcached cluster.
Most resource properties are configurable with Parameters. Additionally, all properties are generally configurable with Variables. The blueprint is extremely flexible and customizable for your needs. More info in the "Configure: More Details" section.
- Add blueprint to Gemfile
- Configure: configs/elasticache values
- Deploy blueprint
Add the blueprint to your lono project's Gemfile
.
gem "elasticache", git: "[email protected]:boltopspro/elasticache.git"
Use the lono seed command to generate a starter config params files.
LONO_ENV=development lono seed elasticache
LONO_ENV=production lono seed elasticache
The files in config/elasticache
folder will look something like this:
configs/elasticache/
├── params
│ ├── development.txt
│ └── production.txt
└── variables
├── development.rb
└── production.rb
Configure the configs/elasticache/params
and configs/elasticache/variables
files. Here's an example:
Engine=memcached # or redis
VpcId=vpc-111
Use the lono cfn deploy command to deploy.
LONO_ENV=development lono cfn deploy elasticache --sure --no-wait
LONO_ENV=production lono cfn deploy elasticache --sure --no-wait
It takes about 5-10m to deploy the ElastiCache cluster. Times may vary.
If you are using One AWS Account, use these commands instead: One Account.
To provision a Redis cluster instead of Memcached, configure the Engine
parameter. Example:
configs/elasticache/params/development.txt:
Engine=redis # memcached or redis
VpcId=vpc-111
To assign existing security groups to the ElastiCache cluster, use the VpcSecurityGroupIds
parameter. Example:
VpcSecurityGroupIds=sg-111,sg-222
Otherwise, the blueprint will create a managed security group for you.
You can assign an existing Cache Subnet Group with the CacheSubnetGroupName
parameter. Example:
CacheSubnetGroupName=subnet-group-name
Or you can have the blueprint create a managed Cache Subnet Group by configuring the Subnets
parameter. Example:
Subnets=subnet-111,subnet-222
Most of the AWS::ElastiCache::CacheCluster properties are configurable with Parameters. Those are are not are configurable with Variables. Here's an example:
@cache_cluster_properties = {
SnapshotName: "my-snapshot",
}
You can view all configurable variables in helpers/variables_helper.rb.
The blueprint is written so that Variables take higher precedence than Parameters.