Skip to content

Commit

Permalink
BFD-2976: Remove ec2 ebs dlm lifecycle (#1996)
Browse files Browse the repository at this point in the history
  • Loading branch information
keithdadkins authored Oct 16, 2023
1 parent 8ed84b9 commit 7bd248a
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 133 deletions.
10 changes: 0 additions & 10 deletions ops/terraform/env/global/dlm/backend.tf

This file was deleted.

16 changes: 0 additions & 16 deletions ops/terraform/env/global/dlm/main.tf

This file was deleted.

87 changes: 0 additions & 87 deletions ops/terraform/modules/resources/dlm/main.tf

This file was deleted.

10 changes: 0 additions & 10 deletions ops/terraform/modules/resources/dlm/variables.tf

This file was deleted.

2 changes: 1 addition & 1 deletion ops/terraform/services/migrator/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ resource "aws_instance" "this" {
}

root_block_device {
tags = merge(local.default_tags, { snapshot = "true" }) # TODO: Consider removing the tag from migrator instances
tags = local.default_tags
volume_type = "gp2"
volume_size = local.volume_size
delete_on_termination = true
Expand Down
7 changes: 2 additions & 5 deletions ops/terraform/services/pipeline/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ locals {
}

pipeline_log_availability = {
period = 1 * 60 * 60 # 1 hour
period = 1 * 60 * 60 # 1 hour
eval_periods = 1
threshold = 0
datapoints = 1
Expand All @@ -86,7 +86,7 @@ locals {
ok_actions = local.is_prod ? [data.aws_sns_topic.ok[0].arn] : []

# The log availability alarm will post an incident in prod; in other envs it will get posted
# to #bfd-test
# to #bfd-test
# TODO: Replace testing SNS topic in BFD-2244
log_availability_alarm_actions = local.is_ephemeral_env ? [] : local.is_prod ? [data.aws_sns_topic.alarm[0].arn] : [data.aws_sns_topic.bfd_test_slack_alarm[0].arn]

Expand Down Expand Up @@ -213,7 +213,6 @@ resource "aws_launch_template" "this" {
{
Layer = local.layer
role = local.legacy_service
snapshot = true
},
each.value.tags
)
Expand Down Expand Up @@ -315,7 +314,6 @@ resource "aws_instance" "pipeline" {
{
Layer = local.layer
role = local.legacy_service
snapshot = true
},
each.value.tags
)
Expand All @@ -336,7 +334,6 @@ resource "aws_instance" "pipeline" {
{
Layer = local.layer
role = local.legacy_service
snapshot = true
},
each.value.tags
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ resource "aws_launch_template" "main" {

tag_specifications {
resource_type = "volume"
tags = merge({ snapshot = "true", Name = "bfd-${local.env}-${var.role}" }, local.additional_tags)
tags = merge({ Name = "bfd-${local.env}-${var.role}" }, local.additional_tags)
}
}

Expand Down
6 changes: 3 additions & 3 deletions ops/utils/backups/purge-old-resources/purge.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
DEBUG = False

## EC2 EBS Retention
# Retain any snapshots associated with an active EC2 volume and purge all others after n days. The filter
# will match DLM lifecycle created snapshots.
# Retain any snapshots associated with an active EC2 volume and purge any snapshots created by the defunct DLM policy
# after n days. The filter will match DLM lifecycle created snapshots.
EC2_MIN_RETENTION_DAYS = 1
EC2_DAILY_EBS_SNAPSHOT_FILTER = [
{'Name': 'description','Values': ['Created for policy*']},
{'Name': 'description','Values': ['Created for policy-0abe3036d255e9ae0']},
{'Name': 'status','Values': ['completed']},
]
#
Expand Down

0 comments on commit 7bd248a

Please sign in to comment.