forked from stojce/terraform-aws-codepipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hooks.tf
33 lines (28 loc) · 808 Bytes
/
hooks.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
resource "aws_codepipeline_webhook" "codepipeline_webhook" {
authentication = "GITHUB_HMAC"
name = "codepipeline-webhook"
target_action = "Source"
target_pipeline = aws_codepipeline.static_web_pipeline.name
authentication_configuration {
secret_token = random_string.github_secret.result
}
filter {
json_path = "$.ref"
match_equals = "refs/heads/{Branch}"
}
tags = {}
}
resource "github_repository_webhook" "github_hook" {
repository = var.repository_name
events = ["push"]
configuration {
url = aws_codepipeline_webhook.codepipeline_webhook.url
insecure_ssl = "0"
content_type = "json"
secret = random_string.github_secret.result
}
}
resource "random_string" "github_secret" {
length = 99
special = false
}