Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CC-2316: Removed the DBF volume from EBS DB instances. #4623

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions terraform/environments/ccms-ebs/application_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"ebs_size_ebsdb_exhome": 100,
"ebs_size_ebsdb_u01": 300,
"ebs_size_ebsdb_arch": 500,
"ebs_size_ebsdb_dbf": 11000,
"ebs_iops_ebsdb_dbf01": 12000,
"ebs_size_ebsdb_dbf01": 4000,
"ebs_iops_ebsdb_dbf02": 12000,
Expand Down Expand Up @@ -152,7 +151,6 @@
"ebs_size_ebsdb_exhome": 100,
"ebs_size_ebsdb_u01": 300,
"ebs_size_ebsdb_arch": 500,
"ebs_size_ebsdb_dbf": 11000,
"ebs_iops_ebsdb_dbf01": 12000,
"ebs_size_ebsdb_dbf01": 4000,
"ebs_iops_ebsdb_dbf02": 12000,
Expand Down Expand Up @@ -234,7 +232,6 @@
"ebs_size_ebsdb_exhome": 100,
"ebs_size_ebsdb_u01": 300,
"ebs_size_ebsdb_arch": 500,
"ebs_size_ebsdb_dbf": 11000,
"ebs_iops_ebsdb_dbf01": 24000,
"ebs_size_ebsdb_dbf01": 4000,
"ebs_iops_ebsdb_dbf02": 24000,
Expand Down Expand Up @@ -316,7 +313,6 @@
"ebs_size_ebsdb_exhome": 100,
"ebs_size_ebsdb_u01": 300,
"ebs_size_ebsdb_arch": 500,
"ebs_size_ebsdb_dbf": 11000,
"ebs_iops_ebsdb_dbf01": 24000,
"ebs_size_ebsdb_dbf01": 4000,
"ebs_iops_ebsdb_dbf02": 24000,
Expand Down
49 changes: 25 additions & 24 deletions terraform/environments/ccms-ebs/ccms-ec2-oracle_ebs-outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,27 @@ output "aws_volume_attachment_arch_att_volume_id" {

#

output "aws_ebs_volume_dbf_arn" {
description = "aws_ebs_volume dbf arn"
value = aws_ebs_volume.dbf.arn
}
#output "aws_ebs_volume_dbf_arn" {
# description = "aws_ebs_volume dbf arn"
# value = aws_ebs_volume.dbf.arn
#}

#

output "aws_volume_attachment_dbf_att_device_name" {
description = "aws_volume_attachment dbf_att device_name"
value = aws_volume_attachment.dbf_att.device_name
}
#output "aws_volume_attachment_dbf_att_device_name" {
# description = "aws_volume_attachment dbf_att device_name"
# value = aws_volume_attachment.dbf_att.device_name
#}

output "aws_volume_attachment_dbf_att_instance_id" {
description = "aws_volume_attachment dbf_att instance_id"
value = aws_volume_attachment.dbf_att.instance_id
}
#output "aws_volume_attachment_dbf_att_instance_id" {
# description = "aws_volume_attachment dbf_att instance_id"
# value = aws_volume_attachment.dbf_att.instance_id
#}

output "aws_volume_attachment_dbf_att_volume_id" {
description = "aws_volume_attachment dbf_att volume_id"
value = aws_volume_attachment.dbf_att.volume_id
}
#output "aws_volume_attachment_dbf_att_volume_id" {
# description = "aws_volume_attachment dbf_att volume_id"
# value = aws_volume_attachment.dbf_att.volume_id
#}

#

Expand Down Expand Up @@ -231,11 +231,12 @@ output "aws_volume_attachment_diag_att_volume_id" {

#

output "aws_cloudwatch_metric_alarm_disk_free_ebsdb_ccms_ebs_dbf_arn" {
description = "aws_cloudwatch_metric_alarm disk_free_ebsdb_ccms_ebs_dbf arn"
value = aws_cloudwatch_metric_alarm.disk_free_ebsdb_ccms_ebs_dbf.arn
}
output "aws_cloudwatch_metric_alarm_disk_free_ebsdb_ccms_ebs_dbf_id" {
description = "aws_cloudwatch_metric_alarm disk_free_ebsdb_ccms_ebs_dbf id"
value = aws_cloudwatch_metric_alarm.disk_free_ebsdb_ccms_ebs_dbf.id
}
#output "aws_cloudwatch_metric_alarm_disk_free_ebsdb_ccms_ebs_dbf_arn" {
# description = "aws_cloudwatch_metric_alarm disk_free_ebsdb_ccms_ebs_dbf arn"
# value = aws_cloudwatch_metric_alarm.disk_free_ebsdb_ccms_ebs_dbf.arn
#}

#output "aws_cloudwatch_metric_alarm_disk_free_ebsdb_ccms_ebs_dbf_id" {
# description = "aws_cloudwatch_metric_alarm disk_free_ebsdb_ccms_ebs_dbf id"
# value = aws_cloudwatch_metric_alarm.disk_free_ebsdb_ccms_ebs_dbf.id
#}
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ resource "aws_cloudwatch_metric_alarm" "disk_free_ebsdb_ccms_ebs_redoa" {
}
}

resource "aws_cloudwatch_metric_alarm" "disk_free_ebsdb_ccms_ebs_dbf" {
alarm_name = "${local.application_data.accounts[local.environment].short_env}-ebs_db-disk_free-ccms_ebs_dbf"
alarm_description = "This metric monitors the amount of free disk space on /CCMS/EBS/dbf mount. If the amount of free disk space on root falls below 20% for 2 minutes, the alarm will trigger"
comparison_operator = "GreaterThanOrEqualToThreshold"
metric_name = "disk_used_percent"
namespace = "CWAgent"
statistic = "Average"
insufficient_data_actions = []

evaluation_periods = local.application_data.cloudwatch_ec2.disk.eval_periods
datapoints_to_alarm = local.application_data.cloudwatch_ec2.disk.eval_periods
period = local.application_data.cloudwatch_ec2.disk.period
threshold = local.application_data.cloudwatch_ec2.disk.threshold_dbf
alarm_actions = [aws_sns_topic.cw_alerts.arn]

dimensions = {
ImageId = aws_instance.ec2_oracle_ebs.ami
path = "/CCMS/EBS/dbf" # local.application_data.accounts[local.environment].dbf_path
InstanceType = aws_instance.ec2_oracle_ebs.instance_type
InstanceId = aws_instance.ec2_oracle_ebs.id
fstype = "ext4"
device = "nvme3n1" # local.application_data.accounts[local.environment].dbf_device
}
}
#resource "aws_cloudwatch_metric_alarm" "disk_free_ebsdb_ccms_ebs_dbf" {
# alarm_name = "${local.application_data.accounts[local.environment].short_env}-ebs_db-disk_free-ccms_ebs_dbf"
# alarm_description = "This metric monitors the amount of free disk space on /CCMS/EBS/dbf mount. If the amount of free disk space on root falls below 20% for 2 minutes, the alarm will trigger"
# comparison_operator = "GreaterThanOrEqualToThreshold"
# metric_name = "disk_used_percent"
# namespace = "CWAgent"
# statistic = "Average"
# insufficient_data_actions = []
#
# evaluation_periods = local.application_data.cloudwatch_ec2.disk.eval_periods
# datapoints_to_alarm = local.application_data.cloudwatch_ec2.disk.eval_periods
# period = local.application_data.cloudwatch_ec2.disk.period
# threshold = local.application_data.cloudwatch_ec2.disk.threshold_dbf
# alarm_actions = [aws_sns_topic.cw_alerts.arn]
#
# dimensions = {
# ImageId = aws_instance.ec2_oracle_ebs.ami
# path = "/CCMS/EBS/dbf" # local.application_data.accounts[local.environment].dbf_path
# InstanceType = aws_instance.ec2_oracle_ebs.instance_type
# InstanceId = aws_instance.ec2_oracle_ebs.id
# fstype = "ext4"
# device = "nvme3n1" # local.application_data.accounts[local.environment].dbf_device
# }
#}

resource "aws_cloudwatch_metric_alarm" "disk_free_ebsdb_ccms_ebs_arch" {
alarm_name = "${local.application_data.accounts[local.environment].short_env}-ebs_db-disk_free-ccms_ebs_arch"
Expand Down
21 changes: 0 additions & 21 deletions terraform/environments/ccms-ebs/ccms-ec2-oracle_ebs_db.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,27 +129,6 @@ resource "aws_volume_attachment" "arch_att" {
instance_id = aws_instance.ec2_oracle_ebs.id
}

resource "aws_ebs_volume" "dbf" {
lifecycle {
ignore_changes = [kms_key_id]
}
availability_zone = "eu-west-2a"
size = local.application_data.accounts[local.environment].ebs_size_ebsdb_dbf
type = "io2"
iops = local.application_data.accounts[local.environment].ebs_default_iops
encrypted = true
kms_key_id = data.aws_kms_key.ebs_shared.key_id
tags = merge(local.tags,
{ Name = "dbf" }
)
}

resource "aws_volume_attachment" "dbf_att" {
device_name = "/dev/sdk"
volume_id = aws_ebs_volume.dbf.id
instance_id = aws_instance.ec2_oracle_ebs.id
}

resource "aws_ebs_volume" "redoA" {
lifecycle {
ignore_changes = [kms_key_id]
Expand Down