Add multi-tenant ALB routing example - #15
Open
FloMicSch wants to merge 1 commit into
Open
Conversation
One Application Load Balancer in front of several applications: two hostnames with their own certificates on a single HTTPS listener, path routing with an exact-match legacy endpoint, header and query parameter rules to a canary pool, cookie persistence on the admin pool, a WebSocket route and one target pool with an active HTTP health check per application. Two backend VMs in different availability zones serve every pool, and each response names the pool and the VM that answered so that every rule can be verified from the response body.
h3adex
self-requested a review
September 2, 2026 09:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
examples/alb-multi-tenant-routing: one Application Load Balancer in front of several applications.app.<domain>andadmin.<domain>share a single HTTPS listener with one certificate each (selected by SNI); the app host carries path routing with an exact-match legacy endpoint, a header rule (X-Canary: true) and a query-parameter rule (preview=true) to a canary pool and a WebSocket route; the admin host uses cookie persistence. Every application has its own target pool with an active HTTP health check. Two backend VMs in different availability zones serve every pool, and each response names the pool and the VM that answered, so every rule can be verified from the response body.The existing ALB examples use a single wildcard host in front of a single target pool; this example covers the layer 7 routing features that were not shown yet:
prefixandexact_match), header and query parameter rules, and the first-match-in-order semantics they depend oncookie_persistence,web_socket, oneactive_health_checkwithhttp_health_checksper poolstackit_alb_certificates on one listener,options.ephemeral_address = true(no reserved public IP)files/server.pyand is injected into cloud-init viatemplatefileTested
Deployed end to end in a sandbox project (
eu01, provider 0.113.0); the README's Testing section lists the commands and the observed results:404by the load balancer)101) on/wsand403on a route withoutweb_socketterraform fmt,terraform validate, pre-commit hooks (prettier, black, gitleaks, addlicense, README tags, file naming) pass;AGENTS.mdregeneratedNotes
stackit beta alb planslists onlyp10ineu01at the time of writing; the plan is a variable with that default.network_cidrhas to lie inside the ranges of the area; the README says so.Checklist