Skip to content

Commit

Permalink
- Renamed resources
Browse files Browse the repository at this point in the history
- Enabled public ip
  • Loading branch information
Ronaldo Macapobre committed Jul 29, 2024
1 parent 4aca9a3 commit ad3f988
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion infrastructure/cloud/modules/container/ecr.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ resource "aws_ecr_repository" "ecr_repository" {
}

tags = {
name = "${var.app_name}-repo-${var.environment}"
name = "${var.app_name}-ecr-repo-${var.environment}"
}
}
10 changes: 5 additions & 5 deletions infrastructure/cloud/modules/container/ecs.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
resource "aws_ecs_cluster" "ecs_cluster" {
name = "${var.app_name}-cluster-${var.environment}"
name = "${var.app_name}-ecs-cluster-${var.environment}"

tags = {
name = "${var.app_name}-cluster-${var.environment}"
name = "${var.app_name}-ecs-cluster-${var.environment}"
}
}

# Web
resource "aws_ecs_task_definition" "ecs_web_task_definition" {
family = "${var.app_name}-web-task-${var.environment}"
family = "${var.app_name}-web-task-definition-${var.environment}"
network_mode = "awsvpc"
requires_compatibilities = ["FARGATE"]
cpu = 256
Expand All @@ -33,7 +33,7 @@ resource "aws_ecs_task_definition" "ecs_web_task_definition" {
}

resource "aws_ecs_service" "ecs_web_service" {
name = "${var.app_name}-service-${var.environment}"
name = "${var.app_name}-ecs-web-service-${var.environment}"
cluster = aws_ecs_cluster.ecs_cluster.id
task_definition = aws_ecs_task_definition.ecs_web_task_definition.arn
launch_type = "FARGATE"
Expand All @@ -42,7 +42,7 @@ resource "aws_ecs_service" "ecs_web_service" {
network_configuration {
subnets = var.subnet_id
security_groups = [var.ecs_sg_id]
assign_public_ip = false
assign_public_ip = true
}

load_balancer {
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/cloud/modules/networking/elb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ resource "aws_lb" "lb" {


resource "aws_lb_target_group" "lb_target_group" {
name = "${var.app_name}-tg-${var.environment}"
name = "${var.app_name}-lb-tg-${var.environment}"
port = 80
protocol = "HTTP"
vpc_id = aws_vpc.vpc.id
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/cloud/modules/networking/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ resource "aws_route_table_association" "route_table_association" {
}

resource "aws_security_group" "ecs_security_group" {
name = "${var.app_name}-sg-${var.environment}"
name = "${var.app_name}-ecs-sg-${var.environment}"
vpc_id = aws_vpc.vpc.id

ingress {
Expand All @@ -47,6 +47,6 @@ resource "aws_security_group" "ecs_security_group" {
}

tags = {
Name = "${var.app_name}-sg-${var.environment}"
Name = "${var.app_name}-ecs-sg-${var.environment}"
}
}

0 comments on commit ad3f988

Please sign in to comment.