Add private internal ALB example with end-to-end TLS - #17
Open
FloMicSch wants to merge 1 commit into
Open
Conversation
An Application Load Balancer without a public address: private listener in one network, backends in another, the exported target security group assigned to the backend interfaces by the configuration, and TLS bridging with a private CA created at apply time, so that the hop from the load balancer to the backends is encrypted and verified as well. A second target pool with an untrusted certificate shows that the validation is enforced, and a jump host in the listener network runs the checks. The listener/target network roles of the API were tried and did not work; the README records the finding and the single-network layout used instead.
Collaborator
|
LGTM |
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-private-internal-endpoint: an internal-only Application Load Balancer. The load balancer has no public address (options.private_network_only = true) and lives in a listener network; the backends run in a separate target network that is reached through the project router. The exportedtarget_security_groupis assigned to the backend interfaces by the configuration (disable_target_security_group_assignment = true). TLS is terminated at the load balancer with a certificate from a private CA and re-established towards the backends, verified against the same CA (tls_configwithcustom_caandskip_certificate_validation = false). A second target pool whose backends present a self-signed certificate shows that the validation is enforced. A jump host in the listener network is the only resource with a public address; it exists to run the checks without a VPN.The existing ALB examples publish services on the internet; this example covers the private side:
options.private_network_onlywithprivate_addressas the only entry point, and the production access paths (VPN gateway, hub-and-spoke routing) the README points todisable_target_security_group_assignmentwith the exportedtarget_security_groupandload_balancer_security_groupcustom_ca; the HTTP health check runs over the pool'stls_configand rejects the untrusted certificate (503 no healthy upstream)tlsprovider at apply time; the listener certificate is uploaded asstackit_alb_certificatefiles/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:externalAddressis null andprivateAddressset atSTATUS_READY; TLS 1.3 from the jump host withVerify return code: 0against the private CA,404for unknown hosts, no listener on port 80503), the pool with the CA-issued certificate passes the identical checktarget_security_grouponly; the load balancer added nothing to themterraform fmt,terraform validate, pre-commit hooks (prettier, black, gitleaks, addlicense, README tags, file naming) pass;AGENTS.mdregeneratedNotes
networksentry withROLE_LISTENERSandROLE_TARGETSis accepted by the API and reachesSTATUS_READY, but the listener never answers on the private address (provider 0.113.0, September 2026); the API reference states that onlyROLE_LISTENERS_AND_TARGETSis supported at this time. The example declares the listener network only and documents the finding.private_network_only,disable_target_security_group_assignment,networksandexternal_addresscannot be changed after creation; the README describes how to detach the target security group from the backend interfaces before replacing the load balancer.stackit beta alb planslists onlyp10ineu01at the time of writing; the plan is a variable with that default.Checklist