Skip to content

fix(aws): restore HTTP health check on concourse LB - #704

Merged
rkoster merged 1 commit into
mainfrom
fix/aws-concourse-lb-http-health-check
Nov 26, 2026
Merged

rkoster merged 1 commit into
mainfrom
fix/aws-concourse-lb-http-health-check

Conversation

@ramonskie

Copy link
Copy Markdown
Contributor

Summary

Fixes #701.

bbl up --lb-type concourse on AWS currently fails during terraform plan with:

Error: Invalid Attribute Combination

Attribute "health_check[0].matcher" cannot be specified when "health_check[0].protocol" is "TCP".

Path: health_check[0].matcher
with aws_lb_target_group.concourse_lb_80,

This restores the HTTP health check on the concourse_lb_80 target group, with an explicit path and matcher.

Why this is failing

bbl's concourse_lb_80 target group was HTTP, then deliberately switched to TCP in d2ab1d97 ("Use network load balancers for AWS Concourse LBs"), the follow-up to the 2017 classic-ELB → NLB migration (65dac071, issue #228).

In 65dac071 the health_check block omitted protocol, and the AWS provider at the time defaulted health_check.protocol to HTTP, so the target group was created with an HTTP check (path = "/", matcher = "200-399"). d2ab1d97 then set protocol = "TCP" and dropped path/matcher.

The commit records no health-check-specific rationale; the 2017 constraints made TCP the pragmatic choice:

  • NLB health checks could not configure a matcher (fixed at 200–399) or a timeout (removed in 3e3eed87).
  • Terraform's NLB support had only just been fixed.
  • TCP also matched the pre-migration classic ELB check (target = "TCP:8080").

TCP itself is not the problem. path and matcher are Optional + Computed, so environments whose target groups were created while the check was HTTP kept the old values in AWS and in state. Removing them from the template never cleared them, and provider v3.75.0+ now fails the plan on TCP + non-empty matcher/path (CustomizeDiff in resourceTargetGroupCustomizeDiff). See hashicorp/terraform-provider-aws#8305.

Why HTTP is safe now

  • NLB already listed HTTP/HTTPS/TCP as health-check protocols in 2017.
  • Since the November 2022 NLB health-check improvements, the matcher range is configurable (200–599).
  • Setting path and matcher explicitly also overwrites the inherited values, so long-lived environments converge on the next apply.
  • matcher = "200-499" is within the NLB-valid range and is the value verified in the issue: 4xx counts as healthy while 5xx still marks a target unhealthy.

Fresh environments are unaffected. This stays a network load balancer; only the health check on the port-80 target group changes.

Testing

  • go test ./terraform/aws/... ✅
  • Not covered by CI: the AWS acceptance jobs are commented out in ci/pipelines/bosh-bootloader.yml, and terraform validate would not catch this anyway — the CustomizeDiff only runs during plan against real credentials.

The AWS provider now rejects a TCP health check that still carries a
non-empty matcher or path:

  Attribute "health_check[0].matcher" cannot be specified when
  "health_check[0].protocol" is "TCP".

bbl's concourse_lb_80 target group was HTTP, then deliberately switched
to TCP in d2ab1d9 ("Use network load balancers for AWS Concourse LBs"),
the follow-up to the 2017 classic-ELB -> NLB migration (65dac07, issue
#228). In 65dac07 the health_check block omitted `protocol`, and the
AWS provider at the time defaulted health_check.protocol to "HTTP", so
the target group was created with an HTTP check (path "/",
matcher "200-399"). d2ab1d9 then set protocol = "TCP" and dropped
path/matcher.

The commit records no health-check rationale; the 2017 constraints made
TCP the pragmatic choice. NLB health checks could not configure a
matcher (fixed at 200-399) or a timeout (removed in 3e3eed8), and
Terraform's NLB support had only just been fixed. TCP also matched the
pre-migration classic ELB check (target = "TCP:8080").

TCP itself is not the problem: `path` and `matcher` are Optional +
Computed, so environments whose target groups were created while the
check was HTTP kept the old values in AWS and in state. Removing them
from the template never cleared them, and provider v3.75.0+ now fails
the plan on TCP + non-empty matcher/path (CustomizeDiff in
resourceTargetGroupCustomizeDiff). Upstream:
hashicorp/terraform-provider-aws#8305.

Restore the HTTP health check. NLB already listed HTTP/HTTPS/TCP as
health-check protocols in 2017, and since the November 2022 health-check
improvements it also allows a configurable matcher range (200-599), so
the constraints behind the 2017 switch no longer apply. Setting path and
matcher explicitly also overwrites the inherited values, so long-lived
environments converge on the next apply. matcher 200-499 is within the
NLB-valid range and is the value verified in the issue: 4xx counts as
healthy while 5xx still marks a target unhealthy.

Fresh environments are unaffected; this stays a network load balancer
and only changes the health check on the port-80 target group.

Fixes: #701
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The port 80 target group health check now uses HTTP on /, with matcher 200-499. It retains thresholds of 10 and an interval of 30 seconds. Comments describe the HTTP check and inherited path and matcher values.

Suggested reviewers: rowanjacobs

Severity of issue fixed: Medium

Merge Risk: Minimal · up to fd472

This change switches the Concourse port-80 target group health check from TCP to HTTP so that bbl up --lb-type concourse can plan on newer AWS provider versions. No concrete defect was found, and the change is small and easy to revert. The AWS plan and apply path was not exercised in CI, so confirm it with a real run if you can.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: it restores an HTTP health check on the Concourse LB target group in the AWS Terraform config. It uses the fix(aws) prefix and is specific, so it passes.
Description check Passed The description states the problem (bbl up --lb-type concourse fails on terraform plan with the invalid attribute combination error), links issue #701, and explains that the change restores an HTTP he…
Linked Issues check Passed Issue #701 requires that bbl up --lb-type concourse stop failing with the invalid attribute combination on aws_lb_target_group.concourse_lb_80, where health_check[0].matcher is rejected when the…
Out of Scope Changes check Passed The whole-PR change set, from the merge base to the reviewed head, is limited to the port-80 target group health check in terraform/aws/templates/concourse_lb.tf (+6/-1 per the summary). The added l…
Full details: Description check

Explanation

The description states the problem (bbl up --lb-type concourse fails on terraform plan with the invalid attribute combination error), links issue #701, and explains that the change restores an HTTP health check with explicit path and matcher. It also covers the root cause and testing, so it is clearly related to the changeset.

Full details: Linked Issues check

Explanation

Issue #701 requires that bbl up --lb-type concourse stop failing with the invalid attribute combination on aws_lb_target_group.concourse_lb_80, where health_check[0].matcher is rejected when the protocol is TCP. At the reviewed head, terraform/aws/templates/concourse_lb.tf sets the concourse_lb_80 target group's health_check to protocol = "HTTP", path = "/", and matcher = "200-499". A TCP health check no longer carries a matcher, so the reported error condition is removed. The load balancer stays load_balancer_type = "network". The other target groups (2222, 443, 8443, 8844) are unchanged. The issue has no coding tests to add. The PR reports go test ./terraform/aws/... passing. That run does not exercise the plan-time CustomizeDiff, so the fix is supported by the configuration change and not by a plan run. The statement that 200-499 was 'verified in the issue' is not in the issue text; it does not change the verdict.

Full details: Out of Scope Changes check

Explanation

The whole-PR change set, from the merge base to the reviewed head, is limited to the port-80 target group health check in terraform/aws/templates/concourse_lb.tf (+6/-1 per the summary). The added lines are the health-check protocol, path, and matcher, plus a comment explaining the change and its link to #701. Each of these directly implements the #701 objective. No unrelated resources, outputs, or variables are modified in the reviewed file. The diff tool was unavailable, so the scope conclusion relies on the full file read at head and the PR summary, not on a diff read.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: bf5b9f74-89be-466a-be50-de38502b1dd7
Commits

Reviewing files that changed from the base of the PR and between bbaf002 and fd47259.

Files selected for processing: 1

  • terraform/aws/templates/concourse_lb.tf

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Nov 19, 2026
@aramprice
aramprice requested review from a team, KauzClay and nouseforaname and removed request for a team November 19, 2026 19:47
@aramprice aramprice moved this from Pending Merge | Prioritized to Pending Review | Discussion in Foundational Infrastructure Working Group Nov 20, 2026
@rkoster
rkoster merged commit 171e61a into main Nov 26, 2026
8 checks passed
@rkoster
rkoster deleted the fix/aws-concourse-lb-http-health-check branch November 26, 2026 16:02
@github-project-automation github-project-automation Bot moved this from Pending Review | Discussion to Done in Foundational Infrastructure Working Group Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

bbl up fails when using --lb-type concourse

2 participants