Created
December 7, 2018 21:05
-
-
Save spy86/e3f9c0a81c9deb7ca5a6b364e828071d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_cloudwatch_event_rule" "codepipeline" { | |
name = "CodePipelineExecutionStateChane" | |
description = "CodePipeline Pipeline Execution State Change" | |
event_pattern = << PATTERN | |
{ | |
"source": [ | |
"aws.codepipeline" | |
], | |
"detail-type": [ | |
"CodePipeline Pipeline Execution State Change" | |
] | |
} | |
PATTERN | |
} | |
resource "aws_cloudwatch_event_target" "codepipeline_to_sns" { | |
rule = "$ {aws_cloudwatch_event_rule.codepipeline.name}" | |
arn = "$ {aws_sns_topic.codepipeline.arn}" | |
input_transformer { | |
input_paths = { | |
PipelineName = "$ .detail.pipeline" | |
State = "$ .detail.state" | |
} | |
input_template = "\" Pipeline [<PipelineName>] execution state changed [<State>] \ "" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment