Home

Awesome

Modernisation Platform Pagerduty Integration Terraform Module

Standards Icon Format Code Icon Scorecards Icon

SCA Icon Terraform SCA Icon

Terraform module for associating SNS topics with PagerDuty services on the Modernisation Platform.

Usage


# 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)
}

module "pagerduty_core_alerts" {
  source                    = "github.com/ministryofjustice/modernisation-platform-terraform-pagerduty-integration?ref=0179859e6fafc567843cd55c0b05d325d5012dc4" # v2.0.0
  sns_topics                = ["config", "securityhub-alarms", "cloudtrail"]
  pagerduty_integration_key = local.pagerduty_integration_keys["core_alerts_cloudwatch"]
}

Adding new PagerDuty sevices

New Pagerduty services can be added here - https://github.com/ministryofjustice/modernisation-platform/blob/main/terraform/pagerduty/services.tf

Once added the integration key should be added to the secret here - https://github.com/ministryofjustice/modernisation-platform/blob/main/terraform/pagerduty/aws.tf#L12

<!--- BEGIN_TF_DOCS --->

Requirements

NameVersion
<a name="requirement_terraform"></a> terraform>= 1.0.1
<a name="requirement_aws"></a> aws~> 5.0

Providers

NameVersion
<a name="provider_aws"></a> aws~> 5.0

Modules

No modules.

Resources

NameType
aws_sns_topic_subscription.pagerduty_subscriptionresource
aws_sns_topic.alarm_topicsdata source

Inputs

NameDescriptionTypeDefaultRequired
<a name="input_pagerduty_integration_key"></a> pagerduty_integration_keyn/astringn/ayes
<a name="input_sns_topics"></a> sns_topicsn/alist(any)n/ayes

Outputs

No outputs.

<!--- END_TF_DOCS --->

Looking for issues?

If you're looking to raise an issue with this module, please create a new issue in the Modernisation Platform repository.

<!-- BEGIN_TF_DOCS -->

Requirements

NameVersion
<a name="requirement_terraform"></a> terraform>= 1.0.1
<a name="requirement_aws"></a> aws~> 5.0

Providers

NameVersion
<a name="provider_aws"></a> aws4.20.1

Modules

No modules.

Resources

NameType
aws_sns_topic_subscription.pagerduty_subscriptionresource
aws_sns_topic.alarm_topicsdata source

Inputs

NameDescriptionTypeDefaultRequired
<a name="input_pagerduty_integration_key"></a> pagerduty_integration_keyn/astringn/ayes
<a name="input_sns_topics"></a> sns_topicsn/alist(any)n/ayes

Outputs

NameDescription
<a name="output_sns_subscription_arn"></a> sns_subscription_arnn/a
<a name="output_sns_topic_arn"></a> sns_topic_arnn/a
<!-- END_TF_DOCS -->