From c9229863292034106c43915a4592c2b1f534d8b2 Mon Sep 17 00:00:00 2001 From: fabidick22 Date: Mon, 3 Jul 2023 15:45:12 -0500 Subject: [PATCH] docs: Add support for multiple webhooks --- README.md | 4 ++-- docs/tf-docs/header.md | 3 +-- variables.tf | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 98f95a2..f09cef9 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ module "flux2-ecr-webhook" { ... repo_mapping = { my-ecr-repo = { - webhook = "https://custom.domain.com/hook/11111111" + webhook = ["https://custom.domain.com/hook/11111111", "https://custom.domain.com/hook/2222222"] } } ... @@ -102,7 +102,7 @@ module "flux2-ecr-webhook" { |------|-------------|------|---------|:--------:| | [app\_name](#input\_app\_name) | Name used for resources to create. | `string` | `"flux2-ecr-webhook"` | no | | [cw\_logs\_retention](#input\_cw\_logs\_retention) | Specifies the number of days you want to retain log events in the specified log group. | `number` | `14` | no | -| [repo\_mapping](#input\_repo\_mapping) | Object with repository mapping, if this variable is set `repo_mapping_file` will be ignored.
**Example:**
{
ecr-repo-name = {
webhook = "https://gitops.domain.com/hook/111111 "
}
test/ecr-repo-name = {
webhook = "https://gitops.domain.com/hook/111111 "
token = "webhook-token "
}
}
| `any` | `null` | no | +| [repo\_mapping](#input\_repo\_mapping) | Object with repository mapping, if this variable is set `repo_mapping_file` will be ignored.
**Example:**
{
ecr-repo-name = {
webhook = ["https://gitops.domain.com/hook/111111" ]
}
test/ecr-repo-name = {
webhook = ["https://gitops.domain.com/hook/111111", "https://gitops.domain.com/hook/222222" ]
token = "webhook-token "
}
}
| `any` | `null` | no | | [repo\_mapping\_file](#input\_repo\_mapping\_file) | YAML file path with repository mapping. | `string` | `""` | no | | [webhook\_token](#input\_webhook\_token) | Webhook default token used to call the Flux receiver. If it doesn't find a `token` attribute in the repository mapping use this token for the webhooks | `string` | `null` | no | diff --git a/docs/tf-docs/header.md b/docs/tf-docs/header.md index b9e206a..853dc10 100644 --- a/docs/tf-docs/header.md +++ b/docs/tf-docs/header.md @@ -18,7 +18,6 @@ graph LR - Add unit tests - Add support for [generic-hmac](https://fluxcd.io/flux/components/notification/receiver/#generic-hmac) - Add support to lambda with VPC (for internal webhook) -- Add support to multiple webhooks ## Usage To use this Terraform module, you must first have created webhooks for each [ImageRepository](https://fluxcd.io/flux/components/image/imagerepositories/) resource in your cluster. @@ -50,7 +49,7 @@ module "flux2-ecr-webhook" { ... repo_mapping = { my-ecr-repo = { - webhook = "https://custom.domain.com/hook/11111111" + webhook = ["https://custom.domain.com/hook/11111111", "https://custom.domain.com/hook/2222222"] } } ... diff --git a/variables.tf b/variables.tf index cb1169d..e3ec322 100644 --- a/variables.tf +++ b/variables.tf @@ -22,10 +22,10 @@ Object with repository mapping, if this variable is set `repo_mapping_file` will ``` { ecr-repo-name = { - webhook = "https://gitops.domain.com/hook/111111 " + webhook = ["https://gitops.domain.com/hook/111111" ] } test/ecr-repo-name = { - webhook = "https://gitops.domain.com/hook/111111 " + webhook = ["https://gitops.domain.com/hook/111111", "https://gitops.domain.com/hook/222222" ] token = "webhook-token " } }