Skip to content

Commit

Permalink
feat(aws): Support for ALB listeners with http-request-method conditi…
Browse files Browse the repository at this point in the history
…ons (#4754)

* feat(aws): Support upsert for http-request-method ALB rule

* Remove returns
  • Loading branch information
caseyhebebrand committed Jul 22, 2020
1 parent 24df2a1 commit f1d1b65
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -489,7 +489,12 @@ class LoadBalancerV2UpsertHandler {
List<Action> actions = getAmazonActionsFromDescription(rule.actions, existingTargetGroups, amazonErrors)

List<RuleCondition> conditions = rule.conditions.collect { condition ->
new RuleCondition().withField(condition.field).withValues(condition.values)
if (condition.field == 'http-request-method') {
HttpRequestMethodConditionConfig httpRequestMethodConditionConfig = new HttpRequestMethodConditionConfig().withValues(condition.values)
new RuleCondition().withField(condition.field).withHttpRequestMethodConfig(httpRequestMethodConditionConfig)
} else {
new RuleCondition().withField(condition.field).withValues(condition.values)
}
}

rules.add(new Rule().withActions(actions).withConditions(conditions).withPriority(rule.priority))
Expand Down

0 comments on commit f1d1b65

Please sign in to comment.