1
1
# Define composite variables for resources
2
2
module "label" {
3
- source = " git::https://github.com/cloudposse/tf_label .git?ref=tags/0.2.0 "
3
+ source = " git::https://github.com/cloudposse/terraform-null-label .git?ref=tags/0.2.1 "
4
4
namespace = " ${ var . namespace } "
5
5
name = " ${ var . name } "
6
6
stage = " ${ var . stage } "
@@ -15,8 +15,9 @@ module "label" {
15
15
resource "aws_security_group" "default" {
16
16
vpc_id = " ${ var . vpc_id } "
17
17
name = " ${ module . label . id } "
18
+
18
19
ingress {
19
- from_port = " ${ var . port } " # Redis
20
+ from_port = " ${ var . port } " # Redis
20
21
to_port = " ${ var . port } "
21
22
protocol = " tcp"
22
23
security_groups = [" ${ var . security_groups } " ]
@@ -29,7 +30,7 @@ resource "aws_security_group" "default" {
29
30
cidr_blocks = [" 0.0.0.0/0" ]
30
31
}
31
32
32
- tags = " ${ module . label . tags } "
33
+ tags = " ${ module . label . tags } "
33
34
}
34
35
35
36
resource "aws_elasticache_subnet_group" "default" {
@@ -56,7 +57,7 @@ resource "aws_elasticache_replication_group" "default" {
56
57
maintenance_window = " ${ var . maintenance_window } "
57
58
notification_topic_arn = " ${ var . notification_topic_arn } "
58
59
59
- tags = " ${ module . label . tags } "
60
+ tags = " ${ module . label . tags } "
60
61
}
61
62
62
63
#
@@ -72,15 +73,15 @@ resource "aws_cloudwatch_metric_alarm" "cache_cpu" {
72
73
period = " 300"
73
74
statistic = " Average"
74
75
75
- threshold = " ${ var . alarm_cpu_threshold_percent } "
76
+ threshold = " ${ var . alarm_cpu_threshold_percent } "
76
77
77
78
dimensions {
78
79
CacheClusterId = " ${ module . label . id } "
79
80
}
80
81
81
- alarm_actions = [" ${ var . alarm_actions } " ]
82
- depends_on = [" aws_elasticache_replication_group.default" ]
83
- tags = " ${ module . label . tags } "
82
+ alarm_actions = [" ${ var . alarm_actions } " ]
83
+ depends_on = [" aws_elasticache_replication_group.default" ]
84
+ tags = " ${ module . label . tags } "
84
85
}
85
86
86
87
resource "aws_cloudwatch_metric_alarm" "cache_memory" {
@@ -93,20 +94,19 @@ resource "aws_cloudwatch_metric_alarm" "cache_memory" {
93
94
period = " 60"
94
95
statistic = " Average"
95
96
96
- threshold = " ${ var . alarm_memory_threshold_bytes } "
97
+ threshold = " ${ var . alarm_memory_threshold_bytes } "
97
98
98
99
dimensions {
99
100
CacheClusterId = " ${ module . label . id } "
100
101
}
101
102
102
- alarm_actions = [" ${ var . alarm_actions } " ]
103
- depends_on = [" aws_elasticache_replication_group.default" ]
104
- tags = " ${ module . label . tags } "
103
+ alarm_actions = [" ${ var . alarm_actions } " ]
104
+ depends_on = [" aws_elasticache_replication_group.default" ]
105
+ tags = " ${ module . label . tags } "
105
106
}
106
107
107
-
108
108
module "dns" {
109
- source = " git::https://github.com/cloudposse/tf_hostname .git?ref=tags/0.1.0 "
109
+ source = " git::https://github.com/cloudposse/terraform-aws-route53-cluster-hostname .git?ref=tags/0.1.1 "
110
110
namespace = " ${ var . namespace } "
111
111
name = " ${ var . name } "
112
112
stage = " ${ var . stage } "
0 commit comments