diff --git a/terraform/environments/corporate-staff-rostering/locals.tf b/terraform/environments/corporate-staff-rostering/locals.tf index 7f3e138a694..f377238bc77 100644 --- a/terraform/environments/corporate-staff-rostering/locals.tf +++ b/terraform/environments/corporate-staff-rostering/locals.tf @@ -19,7 +19,7 @@ locals { enable_ec2_self_provision = true enable_ec2_oracle_enterprise_managed_server = true enable_ec2_user_keypair = true - cloudwatch_metric_alarms = {} + cloudwatch_metric_alarms_default_actions = ["csr_alarms"] route53_resolver_rules = { # outbound-data-and-private-subnets = ["azure-fixngo-domain"] # already set by nomis account } @@ -27,9 +27,8 @@ locals { iam_policies_ec2_default = ["EC2S3BucketWriteAndDeleteAccessPolicy", "ImageBuilderS3BucketWriteAndDeleteAccessPolicy"] s3_iam_policies = ["EC2S3BucketWriteAndDeleteAccessPolicy"] sns_topics = { - # TODO: change this when we have a new csr integration for pagerduty - pagerduty_integrations = { - csr_pagerduty = "csr_alarms" + pagerduty_integrations = { + csr_alarms = "csr_alarms" } } } @@ -86,4 +85,5 @@ locals { baseline_ssm_parameters = {} baseline_sns_topics = {} + } diff --git a/terraform/environments/corporate-staff-rostering/locals_app.tf b/terraform/environments/corporate-staff-rostering/locals_app.tf index 24d78801fbb..1552864857b 100644 --- a/terraform/environments/corporate-staff-rostering/locals_app.tf +++ b/terraform/environments/corporate-staff-rostering/locals_app.tf @@ -1,8 +1,8 @@ locals { - app_ec2_cloudwatch_metric_alarms = merge( + app_ec2_cloudwatch_metric_alarms = merge( module.baseline_presets.cloudwatch_metric_alarms.ec2, module.baseline_presets.cloudwatch_metric_alarms.ec2_cwagent_windows - ) + ) } \ No newline at end of file diff --git a/terraform/environments/corporate-staff-rostering/locals_web.tf b/terraform/environments/corporate-staff-rostering/locals_web.tf index 6e041ebc23f..835f2e07e94 100644 --- a/terraform/environments/corporate-staff-rostering/locals_web.tf +++ b/terraform/environments/corporate-staff-rostering/locals_web.tf @@ -1,8 +1,8 @@ locals { - web_ec2_cloudwatch_metric_alarms = merge( + web_ec2_cloudwatch_metric_alarms = merge( module.baseline_presets.cloudwatch_metric_alarms.ec2, module.baseline_presets.cloudwatch_metric_alarms.ec2_cwagent_windows - ) + ) } \ No newline at end of file diff --git a/terraform/environments/corporate-staff-rostering/monitoring.tf b/terraform/environments/corporate-staff-rostering/monitoring.tf deleted file mode 100644 index 0ac15e2b1f8..00000000000 --- a/terraform/environments/corporate-staff-rostering/monitoring.tf +++ /dev/null @@ -1,26 +0,0 @@ -# Pager duty integration - -# Get the map of pagerduty integration keys from the modernisation platform account -data "aws_secretsmanager_secret" "pagerduty_integration_keys" { - provider = aws.modernisation-platform - name = "pagerduty_integration_keys" -} -data "aws_secretsmanager_secret_version" "pagerduty_integration_keys" { - provider = aws.modernisation-platform - secret_id = data.aws_secretsmanager_secret.pagerduty_integration_keys.id -} - -# Add a local to get the keys -locals { - pagerduty_integration_keys = jsondecode(data.aws_secretsmanager_secret_version.pagerduty_integration_keys.secret_string) -} - -# link the sns topic to the service -module "pagerduty_core_alerts" { - depends_on = [ - aws_sns_topic.csr_alarms, - ] - source = "github.com/ministryofjustice/modernisation-platform-terraform-pagerduty-integration?ref=v2.0.0" - sns_topics = [aws_sns_topic.csr_alarms.name] - pagerduty_integration_key = local.pagerduty_integration_keys["csr_alarms"] -} \ No newline at end of file