Skip to content

Terraform module to create a cloudwatch rule and SNS topic for codepipeline failure notifications

License

Notifications You must be signed in to change notification settings

Mather-Sophi/aws-codepipeline-sns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-codepipeline-sns

Create a cloudwatch rule and SNS topic for codepipeline failure notifications

Usage

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

Notes

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-address@example.com

Inputs

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

Outputs

Name Description
cloudwatch_event_rule_arn
cloudwatch_event_rule_id
sns_topic_arn