Skip to content

Commit 9789b92

Browse files
authored
AWS backup (#15)
* Adding backup feature * Removing efs-backup file * Cleaning up variables * Fixing code format * Adding variable description
1 parent 72d0e6a commit 9789b92

File tree

4 files changed

+10
-65
lines changed

4 files changed

+10
-65
lines changed

_variables.tf

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ variable "alarm_efs_credits_low_threshold" {
130130
default = 1000000000000
131131
}
132132

133-
variable "expire_backup_efs" {
134-
default = 0
135-
description = "Number of days the backup will be expired"
136-
}
137-
138133
variable "target_group_arns" {
139134
default = []
140135
type = list(string)
@@ -188,3 +183,9 @@ variable "schedule_cron_stop" {
188183
default = ""
189184
description = "Cron expression to define when to trigger a stop of the auto-scaling group. E.g. '0 10 * * *' to stop at 10am GMT time"
190185
}
186+
187+
variable "backup" {
188+
type = string
189+
default = "true"
190+
description = "Assing a backup tag to efs resource - Backup will be performed by AWS Backup"
191+
}

cloutwatch-alarms-alb.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ resource "aws_cloudwatch_metric_alarm" "alb_400_errors" {
4343
}
4444

4545
resource "aws_cloudwatch_metric_alarm" "alb_latency" {
46-
count = var.alb && length(var.alarm_sns_topics) > 0 && var.alarm_alb_latency_anomaly_threshold > 0 ? 1 : 0
47-
alarm_name = "${data.aws_iam_account_alias.current.account_alias}-ecs-${var.name}-alb-latency"
46+
count = var.alb && length(var.alarm_sns_topics) > 0 && var.alarm_alb_latency_anomaly_threshold > 0 ? 1 : 0
47+
alarm_name = "${data.aws_iam_account_alias.current.account_alias}-ecs-${var.name}-alb-latency"
4848
# alarm_name = "${data.aws_iam_account_alias.current.account_alias}-ecs-${var.name}-latency"
4949
comparison_operator = "GreaterThanUpperThreshold"
5050
evaluation_periods = "2"

efs-backup.tf

Lines changed: 0 additions & 57 deletions
This file was deleted.

efs.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ resource "aws_efs_file_system" "ecs" {
33
encrypted = true
44

55
tags = {
6-
Name = "ecs-${var.name}"
6+
Name = "ecs-${var.name}"
7+
Backup = var.backup
78
}
89

910
# lifecycle {

0 commit comments

Comments
 (0)