Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 0 additions & 7 deletions aws/wordpress_fargate/alb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ resource "aws_security_group" "alb" {
cidr_blocks = ["0.0.0.0/0"]
}

ingress {
from_port = 0
to_port = 0
protocol = "-1"
self = true
}

tags = var.tags
}

Expand Down
15 changes: 8 additions & 7 deletions aws/wordpress_fargate/db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@ resource "aws_rds_cluster" "this" {
}

resource "aws_db_subnet_group" "this" {
name = "${var.prefix}-${var.environment}"
subnet_ids = module.vpc.private_subnets
tags = var.tags
name = "${var.prefix}-${var.environment}"
description = "database security group"
subnet_ids = module.vpc.private_subnets
tags = var.tags
}

resource "aws_security_group" "db" {
vpc_id = module.vpc.vpc_id
name = "${var.prefix}-db-${var.environment}"
ingress {
protocol = "tcp"
from_port = 3306
to_port = 3306
self = true
protocol = "tcp"
from_port = 3306
to_port = 3306
security_groups = [aws_security_group.wordpress.id]
}

egress {
Expand Down
10 changes: 5 additions & 5 deletions aws/wordpress_fargate/efs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resource "aws_efs_mount_target" "this" {

resource "aws_security_group" "efs" {
name = "${var.prefix}-efs-${var.environment}"
description = "Allow traffic ffrom self"
description = "EFS security group"
vpc_id = module.vpc.vpc_id

egress {
Expand All @@ -25,10 +25,10 @@ resource "aws_security_group" "efs" {
}

ingress {
from_port = 2049
to_port = 2049
protocol = "tcp"
self = true
from_port = 2049
to_port = 2049
protocol = "tcp"
security_groups = [aws_security_group.wordpress.id]
}
tags = var.tags
}
8 changes: 4 additions & 4 deletions aws/wordpress_fargate/fargate.tf
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ resource "aws_security_group" "wordpress" {
}

ingress {
from_port = 0
to_port = 0
from_port = 80
to_port = 80
protocol = "tcp"
security_groups = [aws_security_group.alb.id, aws_security_group.efs.id]
security_groups = [aws_security_group.alb.id]
}

tags = var.tags
Expand All @@ -131,7 +131,7 @@ resource "aws_ecs_service" "this" {
launch_type = "FARGATE"
platform_version = "1.4.0" // required for mounting efs
network_configuration {
security_groups = [aws_security_group.alb.id, aws_security_group.db.id, aws_security_group.efs.id]
security_groups = [aws_security_group.wordpress.id]
subnets = module.vpc.private_subnets
}

Expand Down