Create a cloudwatch rule and SNS topic for codepipeline failure notifications
module "myapp_codepipeline_sns" {
source = "github.com/globeandmail/aws-codepipeline-sns?ref=1.0"
name = "my-app"
codepipeline_arn = "arn:aws:codepipeline:REGION:ACCT:name-of-pipeline"
tags = {
Project = var.project_name
Env = var.env
}
}
You will have to manually add topic subscriptions, as Terraform is unable to generate a subscription ARN until after the email address has been confirmed.
The following AWS CLI example can be used to add a subscription
aws sns subscribe --topic-arn my-topic-ARN --protocol email --notification-endpoint [email protected]
Name | Description | Type | Default | Required |
---|---|---|---|---|
name | The name to use for the SNS topic and cloudwatch rules and event target | string | n/a | yes |
codepipeline_arn | The codepipeline ARN for the cloudwatch rule | string | n/a | yes |
tags | A mapping of tags to assign to the resource | map | {} |
no |
Name | Description |
---|---|
cloudwatch_event_rule_arn | |
cloudwatch_event_rule_id | |
sns_topic_arn |