11# Define composite variables for resources
22module "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 "
44 namespace = " ${ var . namespace } "
55 name = " ${ var . name } "
66 stage = " ${ var . stage } "
@@ -15,8 +15,9 @@ module "label" {
1515resource "aws_security_group" "default" {
1616 vpc_id = " ${ var . vpc_id } "
1717 name = " ${ module . label . id } "
18+
1819 ingress {
19- from_port = " ${ var . port } " # Redis
20+ from_port = " ${ var . port } " # Redis
2021 to_port = " ${ var . port } "
2122 protocol = " tcp"
2223 security_groups = [" ${ var . security_groups } " ]
@@ -29,7 +30,7 @@ resource "aws_security_group" "default" {
2930 cidr_blocks = [" 0.0.0.0/0" ]
3031 }
3132
32- tags = " ${ module . label . tags } "
33+ tags = " ${ module . label . tags } "
3334}
3435
3536resource "aws_elasticache_subnet_group" "default" {
@@ -56,7 +57,7 @@ resource "aws_elasticache_replication_group" "default" {
5657 maintenance_window = " ${ var . maintenance_window } "
5758 notification_topic_arn = " ${ var . notification_topic_arn } "
5859
59- tags = " ${ module . label . tags } "
60+ tags = " ${ module . label . tags } "
6061}
6162
6263#
@@ -72,15 +73,15 @@ resource "aws_cloudwatch_metric_alarm" "cache_cpu" {
7273 period = " 300"
7374 statistic = " Average"
7475
75- threshold = " ${ var . alarm_cpu_threshold_percent } "
76+ threshold = " ${ var . alarm_cpu_threshold_percent } "
7677
7778 dimensions {
7879 CacheClusterId = " ${ module . label . id } "
7980 }
8081
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 } "
8485}
8586
8687resource "aws_cloudwatch_metric_alarm" "cache_memory" {
@@ -93,20 +94,19 @@ resource "aws_cloudwatch_metric_alarm" "cache_memory" {
9394 period = " 60"
9495 statistic = " Average"
9596
96- threshold = " ${ var . alarm_memory_threshold_bytes } "
97+ threshold = " ${ var . alarm_memory_threshold_bytes } "
9798
9899 dimensions {
99100 CacheClusterId = " ${ module . label . id } "
100101 }
101102
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 } "
105106}
106107
107-
108108module "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 "
110110 namespace = " ${ var . namespace } "
111111 name = " ${ var . name } "
112112 stage = " ${ var . stage } "
0 commit comments