Skip to content

Commit

Permalink
cleanup the env
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin-bhadauria committed Jul 28, 2024
1 parent 32ad25e commit 9126ca0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 59 deletions.
49 changes: 15 additions & 34 deletions _variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,11 @@ variable "name" {
description = "Name of your ECS service"
}

variable "php_name" {
description = "Name of your ECS service"
}

variable "container_port" {
default = 8080
description = "Port your container listens (used in the placeholder task definition)"
}

variable "php_container_port" {
default = 9000
description = "Port your sidecar container listens (used in the placeholder task definition)"
}

variable "php_container_port" {
default = 9000
description = "Port your sidecar container listens (used in the placeholder task definition)"
}

variable "port" {
default = 80
description = "Port for target group to listen"
Expand All @@ -41,26 +27,6 @@ variable "cpu" {
description = "Hard limit for CPU for the container"
}

variable "php_memory" {
default = 512
description = "Hard memory of the container"
}

variable "php_cpu" {
default = 0
description = "Hard limit for CPU for the container"
}

variable "php_memory" {
default = 512
description = "Hard memory of the container"
}

variable "php_cpu" {
default = 0
description = "Hard limit for CPU for the container"
}

variable "paths" {
default = []
description = "List of paths to use on listener rule (example: ['/*'])"
Expand Down Expand Up @@ -551,4 +517,19 @@ variable "autoscaling_alb" {
variable "autoscaling_target_alb" {
default = 10
description = "Target ALB Request Count Per Target to track for autoscaling"
}

variable "php_cpu" {
default = 0
description = "Hard limit for CPU for the container"
}

variable "php_memory" {
default = 512
description = "Hard memory of the container"
}

variable "php_container_port" {
default = 9000
description = "Port your sidecar container listens (used in the placeholder task definition)"
}
25 changes: 0 additions & 25 deletions cloudwatch-ecs-event-logs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,4 @@ resource "aws_cloudwatch_event_target" "ecs_events" {
count = var.cloudwatch_logs_create ? 1 : 0
rule = aws_cloudwatch_event_rule.ecs_events[0].name
arn = aws_cloudwatch_log_group.ecs_events[0].arn
}

data "aws_iam_policy_document" "ecs_events" {
count = var.cloudwatch_logs_create ? 1 : 0
statement {
actions = [
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
]

resources = ["${aws_cloudwatch_log_group.ecs_events[0].arn}:*"]

principals {
identifiers = ["events.amazonaws.com", "delivery.logs.amazonaws.com"]
type = "Service"
}
}
}

resource "aws_cloudwatch_log_resource_policy" "ecs_events" {
count = var.cloudwatch_logs_create ? 1 : 0
policy_document = data.aws_iam_policy_document.ecs_events[0].json
policy_name = "capture-ecs-events-${var.cluster_name}-${var.name}"

}

0 comments on commit 9126ca0

Please sign in to comment.