Skip to content

Commit 7243238

Browse files
committed
Replacing comments
1 parent 52a5838 commit 7243238

File tree

4 files changed

+36
-36
lines changed

4 files changed

+36
-36
lines changed

autoscaling.tf

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# ---------------------------------------------------------------------------------------------------------------------
1+
#------------------------------------------------------------------------------
22
# AWS ECS Auto Scale Role
3-
# ---------------------------------------------------------------------------------------------------------------------
3+
#------------------------------------------------------------------------------
44
resource "aws_iam_role" "ecs_autoscale_role" {
55
name = "${var.name_preffix}-ecs-autoscale-role"
66
assume_role_policy = file("${path.module}/files/iam/ecs_autoscale_iam_role.json")
@@ -14,9 +14,9 @@ resource "aws_iam_role_policy" "ecs_autoscale_role_policy" {
1414
)
1515
}
1616

17-
# ---------------------------------------------------------------------------------------------------------------------
17+
#------------------------------------------------------------------------------
1818
# AWS Auto Scaling - CloudWatch Alarm CPU High
19-
# ---------------------------------------------------------------------------------------------------------------------
19+
#------------------------------------------------------------------------------
2020
resource "aws_cloudwatch_metric_alarm" "cpu_high" {
2121
alarm_name = "${var.name_preffix}-cpu-high"
2222
comparison_operator = "GreaterThanOrEqualToThreshold"
@@ -33,9 +33,9 @@ resource "aws_cloudwatch_metric_alarm" "cpu_high" {
3333
alarm_actions = [aws_appautoscaling_policy.scale_up_policy.arn]
3434
}
3535

36-
# ---------------------------------------------------------------------------------------------------------------------
36+
#------------------------------------------------------------------------------
3737
# AWS Auto Scaling - CloudWatch Alarm CPU Low
38-
# ---------------------------------------------------------------------------------------------------------------------
38+
#------------------------------------------------------------------------------
3939
resource "aws_cloudwatch_metric_alarm" "cpu_low" {
4040
alarm_name = "${var.name_preffix}-cpu-low"
4141
comparison_operator = "LessThanOrEqualToThreshold"
@@ -52,9 +52,9 @@ resource "aws_cloudwatch_metric_alarm" "cpu_low" {
5252
alarm_actions = [aws_appautoscaling_policy.scale_down_policy.arn]
5353
}
5454

55-
# ---------------------------------------------------------------------------------------------------------------------
55+
#------------------------------------------------------------------------------
5656
# AWS Auto Scaling - Scaling Up Policy
57-
# ---------------------------------------------------------------------------------------------------------------------
57+
#------------------------------------------------------------------------------
5858
resource "aws_appautoscaling_policy" "scale_up_policy" {
5959
name = "${var.name_preffix}-scale-up-policy"
6060
depends_on = [aws_appautoscaling_target.scale_target]
@@ -72,9 +72,9 @@ resource "aws_appautoscaling_policy" "scale_up_policy" {
7272
}
7373
}
7474

75-
# ---------------------------------------------------------------------------------------------------------------------
75+
#------------------------------------------------------------------------------
7676
# AWS Auto Scaling - Scaling Down Policy
77-
# ---------------------------------------------------------------------------------------------------------------------
77+
#------------------------------------------------------------------------------
7878
resource "aws_appautoscaling_policy" "scale_down_policy" {
7979
name = "${var.name_preffix}-scale-down-policy"
8080
depends_on = [aws_appautoscaling_target.scale_target]
@@ -92,9 +92,9 @@ resource "aws_appautoscaling_policy" "scale_down_policy" {
9292
}
9393
}
9494

95-
# ---------------------------------------------------------------------------------------------------------------------
95+
#------------------------------------------------------------------------------
9696
# AWS Auto Scaling - Scaling Target
97-
# ---------------------------------------------------------------------------------------------------------------------
97+
#------------------------------------------------------------------------------
9898
resource "aws_appautoscaling_target" "scale_target" {
9999
service_namespace = "ecs"
100100
resource_id = "service/${var.ecs_cluster_name}/${aws_ecs_service.service.name}"

main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# ---------------------------------------------------------------------------------------------------------------------
1+
#------------------------------------------------------------------------------
22
# AWS LOAD BALANCER
3-
# ---------------------------------------------------------------------------------------------------------------------
3+
#------------------------------------------------------------------------------
44

55
data "aws_lb" "lb" {
66
arn = var.lb_arn
@@ -26,9 +26,9 @@ data "aws_lb_listener" "lb_https_listeners" {
2626
arn = element(var.lb_https_listeners_arns, count.index)
2727
}
2828

29-
# ---------------------------------------------------------------------------------------------------------------------
29+
#------------------------------------------------------------------------------
3030
# AWS ECS SERVICE
31-
# ---------------------------------------------------------------------------------------------------------------------
31+
#------------------------------------------------------------------------------
3232
resource "aws_ecs_service" "service" {
3333
name = "${var.name_preffix}-service"
3434
# capacity_provider_strategy - (Optional) The capacity provider strategy to use for the service. Can be one or more. Defined below.
@@ -91,9 +91,9 @@ resource "aws_ecs_service" "service" {
9191
}
9292
}
9393

94-
# ---------------------------------------------------------------------------------------------------------------------
94+
#------------------------------------------------------------------------------
9595
# AWS SECURITY GROUP - ECS Tasks, allow traffic only from Load Balancer
96-
# ---------------------------------------------------------------------------------------------------------------------
96+
#------------------------------------------------------------------------------
9797
resource "aws_security_group" "ecs_tasks_sg" {
9898
name = "${var.name_preffix}-ecs-tasks-sg"
9999
description = "Allow inbound access from the LB only"

outputs.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# ---------------------------------------------------------------------------------------------------------------------
1+
#------------------------------------------------------------------------------
22
# AWS ECS SERVICE
3-
# ---------------------------------------------------------------------------------------------------------------------
3+
#------------------------------------------------------------------------------
44
output "aws_ecs_service_service_id" {
55
description = "The Amazon Resource Name (ARN) that identifies the service."
66
value = aws_ecs_service.service.id
@@ -21,9 +21,9 @@ output "aws_ecs_service_service_desired_count" {
2121
value = aws_ecs_service.service.desired_count
2222
}
2323

24-
# ---------------------------------------------------------------------------------------------------------------------
24+
#------------------------------------------------------------------------------
2525
# AWS SECURITY GROUPS
26-
# ---------------------------------------------------------------------------------------------------------------------
26+
#------------------------------------------------------------------------------
2727
output "ecs_tasks_sg_id" {
2828
description = "$${var.name_preffix} ECS Tasks Security Group - The ID of the security group"
2929
value = aws_security_group.ecs_tasks_sg.id

variables.tf

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# ---------------------------------------------------------------------------------------------------------------------
1+
#------------------------------------------------------------------------------
22
# Misc
3-
# ---------------------------------------------------------------------------------------------------------------------
3+
#------------------------------------------------------------------------------
44
variable "name_preffix" {
55
description = "Name preffix for resources on AWS"
66
}
77

8-
# ---------------------------------------------------------------------------------------------------------------------
8+
#------------------------------------------------------------------------------
99
# AWS Networking
10-
# ---------------------------------------------------------------------------------------------------------------------
10+
#------------------------------------------------------------------------------
1111
variable "vpc_id" {
1212
description = "ID of the VPC"
1313
}
1414

15-
# ---------------------------------------------------------------------------------------------------------------------
15+
#------------------------------------------------------------------------------
1616
# AWS ECS SERVICE
17-
# ---------------------------------------------------------------------------------------------------------------------
17+
#------------------------------------------------------------------------------
1818
variable "ecs_cluster_arn" {
1919
description = "ARN of an ECS cluster"
2020
}
@@ -81,9 +81,9 @@ variable "task_definition_arn" {
8181
description = "(Required) The full ARN of the task definition that you want to run in your service."
8282
}
8383

84-
# ---------------------------------------------------------------------------------------------------------------------
84+
#------------------------------------------------------------------------------
8585
# AWS ECS SERVICE network_configuration BLOCK
86-
# ---------------------------------------------------------------------------------------------------------------------
86+
#------------------------------------------------------------------------------
8787
variable "public_subnets" {
8888
description = "The public subnets associated with the task or service."
8989
type = list
@@ -106,23 +106,23 @@ variable "assign_public_ip" {
106106
default = false
107107
}
108108

109-
# ---------------------------------------------------------------------------------------------------------------------
109+
#------------------------------------------------------------------------------
110110
# AWS ECS SERVICE load_balancer BLOCK
111-
# ---------------------------------------------------------------------------------------------------------------------
111+
#------------------------------------------------------------------------------
112112
variable "container_name" {
113113
description = "Name of the running container"
114114
}
115115

116-
# ---------------------------------------------------------------------------------------------------------------------
116+
#------------------------------------------------------------------------------
117117
# AWS ECS SERVICE AUTOSCALING
118-
# ---------------------------------------------------------------------------------------------------------------------
118+
#------------------------------------------------------------------------------
119119
variable "ecs_cluster_name" {
120120
description = "Name of the ECS cluster"
121121
}
122122

123-
# ---------------------------------------------------------------------------------------------------------------------
123+
#------------------------------------------------------------------------------
124124
# AWS LOAD BALANCER
125-
# ---------------------------------------------------------------------------------------------------------------------
125+
#------------------------------------------------------------------------------
126126
variable "lb_arn" {
127127
description = "Load Balancer ARN"
128128
type = string

0 commit comments

Comments
 (0)