Skip to content
This repository was archived by the owner on Oct 8, 2022. It is now read-only.

project naming + security group ingress #11

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
#
# Security group resources
#

resource "aws_security_group" "redis" {
vpc_id = "${var.vpc_id}"
vpc_id = "${var.vpc_id}"
name = "${var.project}-${var.environment}"

tags {
Name = "sgCacheCluster"
Name = "${var.project}-${var.environment}-security-group"
Project = "${var.project}"
Environment = "${var.environment}"
}
}

resource "aws_security_group_rule" "allow_all" {
type = "ingress"
from_port = 6379
to_port = 6379
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]

security_group_id = "${aws_security_group.redis.id}"
}


#
# ElastiCache resources
#
Expand All @@ -29,7 +42,7 @@ resource "aws_elasticache_replication_group" "redis" {
port = "6379"

tags {
Name = "CacheReplicationGroup"
Name = "${var.project}-${var.environment}-replication-group"
Project = "${var.project}"
Environment = "${var.environment}"
}
Expand Down