Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.100.0
rev: v1.100.1
hooks:
- id: terraform_fmt
- id: terraform_wrapper_module_for_each
Expand Down
30 changes: 17 additions & 13 deletions examples/complete-alb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ module "alb" {
weighted_forward = {
target_groups = [
{
key = "ex-lambda-with-trigger"
weight = 2
target_group_key = "ex-lambda-with-trigger"
weight = 2
},
{
key = "ex-instance"
weight = 1
target_group_key = "ex-instance"
weight = 1
}
]
stickiness = {
Expand Down Expand Up @@ -259,15 +259,19 @@ module "alb" {
}
}]

conditions = [{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a no-op, correct? do we need this change for the fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's needed to fix Error: Only one of host_header, http_header, http_request_method, path_pattern, query_string or source_ip can be set in a condition block.

Without the change the module generates one condition block, like this:

condition {
  query_string = ...
  path_pattern = ...
}

which is not correct. Two condition blocks must be used.

query_string = [{
key = "weighted"
value = "true"
}],
path_pattern = {
values = ["/some/path"]
}
}]
conditions = [
{
query_string = [{
key = "weighted"
value = "true"
}]
},
{
path_pattern = {
values = ["/some/path"]
}
},
]
}

ex-redirect = {
Expand Down