mirror of
https://codeberg.org/scottslowe/learning-tools.git
synced 2026-03-11 09:04:37 +00:00
added elasticache resource
This commit is contained in:
parent
12868566c1
commit
2b6ecf412a
3 changed files with 40 additions and 0 deletions
22
terraform/aws/new-elasticache/main.tf
Normal file
22
terraform/aws/new-elasticache/main.tf
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Create a demo memcached cluster
|
||||
resource "aws_elasticache_cluster" "demo_elasticache_memcached_cluster" {
|
||||
cluster_id = var.demo_elasticache_memcached_cluster_name
|
||||
engine = "memcached"
|
||||
// Using smallest node type. Refer AWS docs for all supported node types : https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html
|
||||
node_type = "cache.t3.micro"
|
||||
num_cache_nodes = 2
|
||||
parameter_group_name = "default.memcached1.4"
|
||||
port = 11211
|
||||
}
|
||||
|
||||
// Create a demo redis cluster
|
||||
resource "aws_elasticache_cluster" "demo_elasticache_redis_cluster" {
|
||||
cluster_id = var.demo_elasticache_redis_cluster_name
|
||||
engine = "redis"
|
||||
// Using smallest node type. Refer AWS docs for all supported node types : https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html
|
||||
node_type = "cache.t3.micro"
|
||||
num_cache_nodes = 1
|
||||
parameter_group_name = "default.redis3.2"
|
||||
engine_version = "3.2.10"
|
||||
port = 6379
|
||||
}
|
||||
7
terraform/aws/new-elasticache/output.tf
Normal file
7
terraform/aws/new-elasticache/output.tf
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
output "demo_elasticache_memcached_cluster_name" {
|
||||
value = "${aws_elasticache_cluster.demo_elasticache_memcached_cluster.cluster_id}"
|
||||
}
|
||||
|
||||
output "demo_elasticache_redis_cluster_name" {
|
||||
value = "${aws_elasticache_cluster.demo_elasticache_redis_cluster.cluster_id}"
|
||||
}
|
||||
11
terraform/aws/new-elasticache/variables.tf
Normal file
11
terraform/aws/new-elasticache/variables.tf
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
variable "demo_elasticache_memcached_cluster_name" {
|
||||
type = "string"
|
||||
default = ""
|
||||
description = "AWS memcached elasticache cluster name"
|
||||
}
|
||||
|
||||
variable "demo_elasticache_redis_cluster_name" {
|
||||
type = "string"
|
||||
default = ""
|
||||
description = "AWS redis elasticache cluster name"
|
||||
}
|
||||
Loading…
Reference in a new issue