|
@@ -81,6 +81,7 @@ resource "aws_codebuild_project" "this" {
|
|
|
|
|
|
resource "aws_codebuild_webhook" "this" {
|
|
|
# Disable the webhook for now. It is too aggresive when making quick changes.
|
|
|
+ count = var.enable_webhook == true ? 1 : 0
|
|
|
project_name = var.name
|
|
|
filter_group {
|
|
|
filter {
|
|
@@ -97,13 +98,14 @@ resource "aws_codebuild_webhook" "this" {
|
|
|
}
|
|
|
|
|
|
resource "github_repository_webhook" "this" {
|
|
|
+ count = var.enable_webhook == true ? 1 : 0
|
|
|
active = true
|
|
|
events = ["push"]
|
|
|
repository = data.github_repository.this.name
|
|
|
|
|
|
configuration {
|
|
|
- url = aws_codebuild_webhook.this.payload_url
|
|
|
- secret = aws_codebuild_webhook.this.secret
|
|
|
+ url = aws_codebuild_webhook.this[count.index].payload_url
|
|
|
+ secret = aws_codebuild_webhook.this[count.index].secret
|
|
|
content_type = "json"
|
|
|
insecure_ssl = false
|
|
|
}
|