Skip to content

Commit

Permalink
refactor: Add 'repo_mapping' variable, useful if you don't want to us…
Browse files Browse the repository at this point in the history
…e a YAML file
  • Loading branch information
fabidick22 committed May 5, 2023
1 parent dfdea2a commit fc95b54
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ graph LR
|------|-------------|------|---------|:--------:|
| <a name="input_app_name"></a> [app\_name](#input\_app\_name) | Name used for resources to create. | `string` | `"flux2-ecr-webhook"` | no |
| <a name="input_cw_logs_retention"></a> [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 |
| <a name="input_repo_mapping"></a> [repo\_mapping](#input\_repo\_mapping) | Object with repository mapping. | `any` | `null` | no |
| <a name="input_repo_mapping"></a> [repo\_mapping](#input\_repo\_mapping) | Object with repository mapping, if this variable is set `repo_mapping_file` will be ignored. | `any` | `null` | no |
| <a name="input_repo_mapping_file"></a> [repo\_mapping\_file](#input\_repo\_mapping\_file) | YAML file path with repository mapping. | `string` | `""` | no |
| <a name="input_webhook_token"></a> [webhook\_token](#input\_webhook\_token) | Webhook token used to call the Flux receiver. | `string` | `null` | no |

Expand Down
2 changes: 1 addition & 1 deletion locals.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
repo_mapping = yamldecode(file(var.repo_mapping_file))
repo_mapping = var.repo_mapping == null ? yamldecode(file(var.repo_mapping_file)) : var.repo_mapping
}
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ variable "app_name" {
variable "repo_mapping_file" {
description = "YAML file path with repository mapping."
type = string
default = ""
}

variable "repo_mapping" {
description = "Object with repository mapping, if this variable is set `repo_mapping_file` will be ignored."
type = any
default = null
}

variable "webhook_token" {
Expand Down

0 comments on commit fc95b54

Please sign in to comment.