Terraform module for associating SNS topics with PagerDuty services on the Modernisation Platform.
# 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=d88bd90d490268896670a898edfaba24bba2f8ab" # v3.0.0
sns_topics = ["config", "securityhub-alarms", "cloudtrail"]
pagerduty_integration_key = local.pagerduty_integration_keys["core_alerts_cloudwatch"]
}
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
| Name | Version |
|---|---|
| terraform | >= 1.0.1 |
| aws | ~> 6.0 |
| Name | Version |
|---|---|
| aws | ~> 6.0 |
No modules.
| Name | Type |
|---|---|
| aws_sns_topic_subscription.pagerduty_subscription | resource |
| aws_sns_topic.alarm_topics | data source |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| pagerduty_integration_key | n/a | string |
n/a | yes |
| sns_topics | n/a | list(any) |
n/a | yes |
No outputs.
If you're looking to raise an issue with this module, please create a new issue in the Modernisation Platform repository.
| Name | Version |
|---|---|
| terraform | ~> 1.0 |
| aws | ~> 6.0 |
| Name | Version |
|---|---|
| aws | ~> 6.0 |
No modules.
| Name | Type |
|---|---|
| aws_sns_topic_subscription.pagerduty_subscription | resource |
| aws_sns_topic.alarm_topics | data source |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| pagerduty_integration_key | n/a | string |
n/a | yes |
| sns_topics | n/a | list(any) |
n/a | yes |
| Name | Description |
|---|---|
| sns_subscription_arn | n/a |
| sns_topic_arn | n/a |