feat: support centralised webhook proxy in multi-account deployments#5122
Open
Safouak wants to merge 1 commit into
Open
feat: support centralised webhook proxy in multi-account deployments#5122Safouak wants to merge 1 commit into
Safouak wants to merge 1 commit into
Conversation
When deploying runners with a centralised webhook proxy in a separate AWS account (e.g. an Ops account that validates and authorises webhook events before routing them to target accounts), three gaps force consumers to work around the module: 1. The module exclusively owns the SQS queue policy (DenyInsecureTransport only). Adding cross-account sqs:SendMessage requires overriding the whole policy, duplicating DenyInsecureTransport and causing permanent Terraform drift on every plan. 2. aws_sqs_queue_policy requires the queue URL, not the ARN. The queues output only exposed the ARN, forcing consumers to reconstruct the URL by string-splitting. 3. The webhook Lambda and API Gateway are always deployed even when the module's built-in webhook is not used (the external proxy receives GitHub events directly and publishes to SQS, bypassing the module's endpoint). Changes (root module + modules/multi-runner): - sqs_build_queue_extra_policy_json (default: null): optional policy JSON merged into the build queue policy via source_policy_documents. No-op when unset — no behaviour change for existing deployments. - build_queue_url added to the queues output (root); queues output added to modules/multi-runner exposing ARN + URL per runner key. - create_webhook_module (default: true): set to false to skip the webhook Lambda and API Gateway. The webhook output becomes null when disabled.
34717f5 to
315b095
Compare
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
When deploying runners with a centralised webhook proxy in a separate AWS account (e.g. an account that validates and authorises webhook events before routing them to target accounts), three gaps force consumers to work around the module:
SQS queue policy drift — the module exclusively owns the build queue policy (
DenyInsecureTransportonly). Adding cross-accountsqs:SendMessagerequires overriding the whole policy, duplicatingDenyInsecureTransportand causing permanent Terraform drift.Queue URL not exposed —
aws_sqs_queue_policyrequires the queue URL, but thequeuesoutput only exposed the ARN, forcing consumers to reconstruct the URL by string-splitting.Webhook always deployed — the webhook Lambda and API Gateway are always created even when an external proxy handles webhook delivery.
Changes (root module +
modules/multi-runner)sqs_build_queue_extra_policy_json(default:null): optional policy JSON merged into the build queue policy viasource_policy_documents.No-op when unset.
build_queue_urladded to the rootqueuesoutput; newqueuesoutput added tomodules/multi-runnerexposing ARN + URL per runner key.create_webhook_module(default:true): set tofalseto skip the webhook Lambda and API Gateway. Thewebhookoutput becomesnullwhen disabled.