Skip to content

Commit e5fb082

Browse files
author
Hector Castro
committed
Merge branch 'release/0.2.0'
2 parents 6d758a3 + dbde509 commit e5fb082

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.2.0
2+
3+
- Remove hardcoded identifiers and interpolate the new `cache_name` variable to
4+
create unique resource names.
5+
16
## 0.1.0
27

38
- Initial release.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module "redis_elasticache" {
1111
vpc_id = "vpc-20f74844"
1212
vpc_cidr_block = "10.0.0.0/16"
1313

14+
cache_name = "cache"
1415
engine_version = "2.8.22"
1516
instance_type = "cache.t2.micro"
1617
maintenance_window = "sun:05:00-sun:06:00"
@@ -25,6 +26,7 @@ module "redis_elasticache" {
2526

2627
- `vpc_id` - ID of VPC meant to house the cache
2728
- `vpc_cidr_block` - CIDR block of VPC
29+
- `cache_name` - Name used as ElastiCache cluster ID
2830
- `engine_version` - Cache engine version (default: `2.8.22`)
2931
- `instance_type` - Instance type for cache instance (default: `cache.t2.micro`)
3032
- `maintenance_window` - 60 minute time window to reserve for maintenance

main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#
44

55
resource "aws_security_group" "redis" {
6-
name = "cache-security-group"
76
vpc_id = "${var.vpc_id}"
87

98
ingress {
@@ -30,7 +29,7 @@ resource "aws_security_group" "redis" {
3029
#
3130

3231
resource "aws_elasticache_cluster" "redis" {
33-
cluster_id = "cache"
32+
cluster_id = "${var.cache_name}"
3433
engine = "redis"
3534
engine_version = "${var.engine_version}"
3635
maintenance_window = "${var.maintenance_window}"
@@ -47,7 +46,7 @@ resource "aws_elasticache_cluster" "redis" {
4746
}
4847

4948
resource "aws_elasticache_subnet_group" "default" {
50-
name = "cache-subnet-group"
49+
name = "${var.cache_name}-subnet-group"
5150
description = "Private subnets for the ElastiCache instances"
5251
subnet_ids = ["${split(",", var.private_subnet_ids)}"]
5352
}

variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
variable "vpc_id" { }
22
variable "vpc_cidr_block" { }
33

4+
variable "cache_name" { }
45
variable "engine_version" {
56
default = "2.8.22"
67
}

0 commit comments

Comments
 (0)