Skip to content

Commit 6f93e4c

Browse files
committed
v2.1 -> latest tags
Signed-off-by: John Ritsema <[email protected]>
1 parent c2003fb commit 6f93e4c

File tree

4 files changed

+49
-44
lines changed

4 files changed

+49
-44
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.terraform
2+
terraform.tfstate
3+
terraform.tfstate.backup
4+
examples/open/main.tf

main.tf

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,40 @@
1-
#
2-
# Security group resources
3-
#
4-
51
resource "aws_security_group" "redis" {
62
vpc_id = "${var.vpc_id}"
73

84
tags {
9-
Name = "${var.tag_name}"
10-
environment = "${var.tag_environment}"
11-
team = "${var.tag_team}"
12-
application = "${var.tag_application}"
5+
Name = "${var.tag_name}"
6+
environment = "${var.tag_environment}"
7+
team = "${var.tag_team}"
8+
application = "${var.tag_application}"
9+
contact-email = "${var.tag_contact-email}"
10+
tag_customer = "${var.tag_customer}"
1311
}
1412
}
1513

16-
#
17-
# ElastiCache resources
18-
#
19-
2014
resource "aws_elasticache_subnet_group" "default" {
21-
name = "subnet-group-${var.tag_team}-${var.tag_application}-${var.tag_environment}"
15+
name = "subnet-group-${var.tag_team}-${var.tag_application}-${var.tag_environment}"
2216
description = "Private subnets for the ElastiCache instances: ${var.tag_team} ${var.tag_application} ${var.tag_environment}"
23-
subnet_ids = ["${split(",", var.private_subnet_ids)}"]
17+
subnet_ids = ["${split(",", var.private_subnet_ids)}"]
2418
}
2519

2620
resource "aws_elasticache_cluster" "redis" {
27-
cluster_id = "${var.cluster_id}"
28-
engine = "redis"
29-
engine_version = "${var.engine_version}"
30-
maintenance_window = "${var.maintenance_window}"
31-
node_type = "${var.instance_type}"
32-
num_cache_nodes = "1"
21+
cluster_id = "${var.cluster_id}"
22+
engine = "redis"
23+
engine_version = "${var.engine_version}"
24+
maintenance_window = "${var.maintenance_window}"
25+
node_type = "${var.instance_type}"
26+
num_cache_nodes = "1"
3327
parameter_group_name = "${var.parameter_group_name}"
34-
port = "6379"
35-
subnet_group_name = "${aws_elasticache_subnet_group.default.name}"
36-
security_group_ids = ["${aws_security_group.redis.id}"]
28+
port = "6379"
29+
subnet_group_name = "${aws_elasticache_subnet_group.default.name}"
30+
security_group_ids = ["${aws_security_group.redis.id}"]
3731

3832
tags {
39-
Name = "${var.tag_name}"
40-
environment = "${var.tag_environment}"
41-
team = "${var.tag_team}"
42-
application = "${var.tag_application}"
33+
Name = "${var.tag_name}"
34+
environment = "${var.tag_environment}"
35+
team = "${var.tag_team}"
36+
application = "${var.tag_application}"
37+
contact-email = "${var.tag_contact-email}"
38+
tag_customer = "${var.tag_customer}"
4339
}
4440
}
45-
46-
#
47-
# todo: add CloudWatch resources
48-
#

readme.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,26 @@ A Terraform module that represents an AWS ElastiCache Redis cluster. Note that
55
### Usage
66

77
```terraform
8-
module "elasticache_redis" {
9-
source = "github.com/turnerlabs/terraform-aws-elasticache-redis?ref=v2.0"
10-
11-
cluster_id = "myteam-myapp-dev"
8+
provider "aws" {
9+
region = "us-east-1"
10+
}
1211
13-
vpc_id = "vpc-20f74844"
14-
private_subnet_ids = "subnet-4a887f3c,subnet-76dae35d"
12+
module "elasticache_redis" {
13+
source = "github.com/turnerlabs/terraform-aws-elasticache-redis?ref=v2.1"
1514
16-
engine_version = "2.8.24"
17-
instance_type = "cache.m3.medium"
15+
cluster_id = "myteam-myapp-dev"
16+
engine_version = "2.8.24"
17+
instance_type = "cache.m3.medium"
1818
maintenance_window = "sun:05:00-sun:06:00"
19-
20-
tag_name = "redis"
21-
tag_environment = "dev"
22-
tag_team = "myteam"
23-
tag_application = "myapp"
19+
vpc_id = "vpc-d070efb3"
20+
private_subnet_ids = "subnet-020d8b59,subnet-13f50b64"
21+
22+
tag_name = "myteam-myapp-dev"
23+
tag_team = "my-team"
24+
tag_contact-email = "[email protected]"
25+
tag_application = "my-app"
26+
tag_environment = "dev"
27+
tag_customer = "my-customer"
2428
}
2529
```
2630

@@ -38,6 +42,8 @@ module "elasticache_redis" {
3842
- `tag_environment`
3943
- `tag_team`
4044
- `tag_application`
45+
- `tag_customer`
46+
- `tag_contact-email`
4147

4248

4349
### Outputs

variables.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ variable "maintenance_window" {
2323

2424
# tags
2525
variable "tag_name" {}
26+
2627
variable "tag_environment" {}
2728
variable "tag_team" {}
2829
variable "tag_application" {}
30+
variable "tag_contact-email" {}
31+
variable "tag_customer" {}

0 commit comments

Comments
 (0)