AWS ElastiCache Parameter Group
This page shows how to write Terraform and CloudFormation for ElastiCache Parameter Group and write them securely.
aws_elasticache_parameter_group (Terraform)
The Parameter Group in ElastiCache can be configured in Terraform with the resource name aws_elasticache_parameter_group. The following sections describe 3 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_elasticache_parameter_group" "default" {
name = "cache-params"
family = "redis3.2"
resource "aws_elasticache_parameter_group" "kong" {
name = format("%s-%s", var.service, var.environment)
family = var.redis_family
description = var.description
}
resource "aws_elasticache_parameter_group" "memcached" {
name = "memcache-parameter-group"
family = "memcached1.6"
Parameters
-
descriptionoptional - string -
familyrequired - string -
idoptional computed - string -
namerequired - string -
parameterset block
Explanation in Terraform Registry
Provides an ElastiCache parameter group resource.
NOTE: Attempting to remove the
reserved-memoryparameter whenfamilyis set toredis2.6orredis2.8may show a perpetual difference in Terraform due to an Elasticache API limitation. Leave that parameter configured with any value to workaround the issue.
Tips: Best Practices for The Other AWS ElastiCache Resources
In addition to the aws_elasticache_cluster, AWS ElastiCache has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.
aws_elasticache_cluster
Ensure to enable backup retention of Elasitcache
It's better to take snapshots of Redis clusters to improve data availability.
aws_elasticache_replication_group
Ensure to enable in-transit encryption of ElastiCache
It's better to enable in-transit encryption of ElastiCahe. If the ElastiCache replication group uses unencrypted traffic, it is vulnerable to meet-in-the-middle (MITM) attacks.
AWS::ElastiCache::ParameterGroup (CloudFormation)
The ParameterGroup in ElastiCache can be configured in CloudFormation with the resource name AWS::ElastiCache::ParameterGroup. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
CacheParameterGroupFamilyrequired - String -
Descriptionrequired - String -
Propertiesoptional - Map -
Tagsoptional - List of Tag
Explanation in CloudFormation Registry
The
AWS::ElastiCache::ParameterGrouptype creates a new cache parameter group. Cache parameter groups control the parameters for a cache cluster.
Frequently asked questions
What is AWS ElastiCache Parameter Group?
AWS ElastiCache Parameter Group is a resource for ElastiCache of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS ElastiCache Parameter Group?
For Terraform, the anantha199456/elastic-cache-challenge, awsautomation/kongUAT and LKHetzel/tftest source code examples are useful. See the Terraform Example section for further details.