A Terraform module that represents an AWS ElastiCache Redis cluster and a Lambda function that connects to it. See example usage below.
-
Download
demo-lambda-redis.zipinto the folder you are terraforming from. -
Run terraform, here is a sample plan
provider "aws" {
version = "~> 1.8.0"
region = "us-east-1"
}
module "elasticache_redis" {
source = "github.com/udaysharma/terraform-aws-redis-lambda?ref=v1.0"
cluster_id = "Sandbox-redis"
engine_version = "2.8.24"
instance_type = "cache.t2.micro"
maintenance_window = "sun:05:00-sun:06:00"
vpc_id = "vpc-xxxxxxxx"
private_subnet_ids = "subnet-xxxxxxxx,subnet-yyyyyyyy"
private_subnet_cidrs = "x.x.x.x/x,y.y.y.y/y"
parameter_group_name = "default.redis2.8"
tag_name = "Sandbox-redis"
tag_contact-email = "example@domain.com"
attach_vpc_config = true
}cluster_id- ID of the clustervpc_id- ID of VPC meant to house the cacheprivate_subnet_ids- Comma delimited list of private subnet IDsengine_version- Cache engine version (default:2.8.24)instance_type- Instance type for cache instance (default:cache.t2.micro)maintenance_window- 60 minute time window to reserve for maintenance (default:sun:05:00-sun:06:00)parameter_group_name- Name of the parameter group to associate with this cache cluster (default:default.redis2.8)tag_name- Name tag for the Elasticache Redis clustertag_contact-email- Email tag for the Elasticache Redis cluster
hostname- Public DNS name of cache nodeport- Port of cache instanceendpoint- Public DNS name and port separated by a:cache_security_group_id- Security group ID of the cache clusteriam-role-arn- ARN for IAM role created for Lambda function
MIT © Uday Sharma