Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abderrazak-bouadma/49dff8680b6e432df4b493fabe1d4fa2 to your computer and use it in GitHub Desktop.
Save abderrazak-bouadma/49dff8680b6e432df4b493fabe1d4fa2 to your computer and use it in GitHub Desktop.
terraform-redis
provider "aws" {
region = "your_aws_region"
}
resource "aws_elasticache_subnet_group" "example" {
name = "example"
subnet_ids = ["subnet-xxxxxxxxxxxxxxxxx", "subnet-yyyyyyyyyyyyyyyyy"]
}
resource "aws_elasticache_parameter_group" "example" {
name = "example"
parameter {
name = "tcp-keep-alive"
value = "300"
}
parameter {
name = "timeout"
value = "60"
}
}
resource "aws_elasticache_cluster" "example" {
cluster_id = "example-redis-cluster"
engine = "redis"
engine_version = "6.x"
node_type = "cache.t2.micro"
num_cache_nodes = 1
subnet_group_name = aws_elasticache_subnet_group.example.name
parameter_group_name = aws_elasticache_parameter_group.example.name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment