Create named bitbucket webhook

Hi,

Please suggest how to create named bitbucket webhoks attached to codebuild?

Code:

resource "aws_codebuild_webhook" "build_webhook" {
  for_each     = local.project_with_hooks
  project_name = "${each.key}-${var.environment}"
  name = "${each.key}-${var.environment}"

  dynamic "filter_group" {
    for_each = each.value.hooks
    iterator = hook
    content {
      dynamic "filter" {
        for_each = hook.value.filters
        iterator = filter
        content {
          type    = filter.value.type
          pattern = filter.value.pattern
        }
      }
    }
  }
  depends_on = [aws_codebuild_project.this]
}

It will create a repository hook with Title AWS CodeBuild, that makes hard inspect workflow in case multiple jobs attached to same repo.

I suspect can try to make an api call to rename after creation but maybe there is some right way?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.