File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.2.0
2
+
3
+ - Remove hardcoded identifiers and interpolate the new ` cache_name ` variable to
4
+ create unique resource names.
5
+
1
6
## 0.1.0
2
7
3
8
- Initial release.
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ module "redis_elasticache" {
11
11
vpc_id = " vpc-20f74844"
12
12
vpc_cidr_block = " 10.0.0.0/16"
13
13
14
+ cache_name = " cache"
14
15
engine_version = " 2.8.22"
15
16
instance_type = " cache.t2.micro"
16
17
maintenance_window = " sun:05:00-sun:06:00"
@@ -25,6 +26,7 @@ module "redis_elasticache" {
25
26
26
27
- ` vpc_id ` - ID of VPC meant to house the cache
27
28
- ` vpc_cidr_block ` - CIDR block of VPC
29
+ - ` cache_name ` - Name used as ElastiCache cluster ID
28
30
- ` engine_version ` - Cache engine version (default: ` 2.8.22 ` )
29
31
- ` instance_type ` - Instance type for cache instance (default: ` cache.t2.micro ` )
30
32
- ` maintenance_window ` - 60 minute time window to reserve for maintenance
Original file line number Diff line number Diff line change 3
3
#
4
4
5
5
resource "aws_security_group" "redis" {
6
- name = " cache-security-group"
7
6
vpc_id = " ${ var . vpc_id } "
8
7
9
8
ingress {
@@ -30,7 +29,7 @@ resource "aws_security_group" "redis" {
30
29
#
31
30
32
31
resource "aws_elasticache_cluster" "redis" {
33
- cluster_id = " cache "
32
+ cluster_id = " ${ var . cache_name } "
34
33
engine = " redis"
35
34
engine_version = " ${ var . engine_version } "
36
35
maintenance_window = " ${ var . maintenance_window } "
@@ -47,7 +46,7 @@ resource "aws_elasticache_cluster" "redis" {
47
46
}
48
47
49
48
resource "aws_elasticache_subnet_group" "default" {
50
- name = " cache -subnet-group"
49
+ name = " ${ var . cache_name } -subnet-group"
51
50
description = " Private subnets for the ElastiCache instances"
52
51
subnet_ids = [" ${ split (" ," , var. private_subnet_ids )} " ]
53
52
}
Original file line number Diff line number Diff line change 1
1
variable "vpc_id" { }
2
2
variable "vpc_cidr_block" { }
3
3
4
+ variable "cache_name" { }
4
5
variable "engine_version" {
5
6
default = " 2.8.22"
6
7
}
You can’t perform that action at this time.
0 commit comments