feat(0026): wire enrichment Lambda into CDK + gate the lambda bin#65
Merged
Conversation
Author the production EventBridge cron Lambda for the close_usd / volume_quote_usd enrichment pass (prepare-only; no deploy): - infra: EnrichmentRule (rate(1 hour)) + worker Function + IAM role + error alarm in eventbridge-stack via the shared createWorkerLambda helper, matching the oracle/cleanup/supply pattern. Add `enrichment` to the schedule config type, its validation, and production.json. `cdk synth` produces the rule, function, role, error alarm and log group. - crate: gate the Lambda bin behind a `lambda` feature (required-features) so default builds stay lean, mirroring the sibling workers. The entrypoint now builds the mTLS client via prices_clickhouse::mtls::client_from_lambda_env (CH_DOMAIN + MTLS_SECRET_NAME) instead of a plain CLICKHOUSE_URL client. Add ChEnrichmentPass::with_client for the pre-built client; the url-based new() stays for the integration tests. - ci: add -p enrichment-worker to the cargo lambda build matrix. Custom EnrichmentRowsRemainingAtVolumeZero metric + alarm and the CloudWatch publish remain for the observability task (0056) / Option 2. 24 unit + 2 e2e pass; default + lambda-feature build clean; cargo-lambda bootstrap builds; infra lint/build/typecheck + cdk synth green.
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.
Summary
Authors the production EventBridge cron Lambda for the
close_usd/volume_quote_usdenrichment pass and packages the worker like its siblings — prepare-only, no deploy (Option 1 of the 0026 remaining-work split).EnrichmentRule(rate(1 hour)) + workerFunction+ IAM role + error alarm + log group ineventbridge-stack.tsvia the sharedcreateWorkerLambdahelper, mirroring oracle/cleanup/supply. Addsenrichmentto the schedule config type, its validation, andproduction.json.lambdafeature (required-features) so default builds stay lean, matching the sibling workers. The entrypoint now builds the mTLS client viaprices_clickhouse::mtls::client_from_lambda_env(CH_DOMAIN+MTLS_SECRET_NAME) instead of a plainCLICKHOUSE_URLclient; the prior fixture-prototype Lambda mode is dropped (the prototype lives on asenrichment-cli). AddsChEnrichmentPass::with_client; url-basednew()is kept for the integration tests.-p enrichment-workerto thecargo lambda buildmatrix.Verification (local)
--features lambdabuilds clean; 24 unit + 2 e2e pass; clippy/fmt clean;cargo lambda buildproduces thebootstrap.cdk synthsucceeds — the template carries the rule (rate(1 hour)→ function), function (mTLS env contract +CLICKHOUSE_*, 512 MB / 300 s / arm64), IAM role, error alarm, and log group.Scope / deferred
Closes the EventBridge-Lambda-exists + CDK/IAM ACs at the code+synth level. Still deferred: the custom
EnrichmentRowsRemainingAtVolumeZerometric + CloudWatch publish + dashboard (task 0056), the one-shot historical mode, and the actual deploy + live backfill credibility check — all out of scope under prepare-not-deploy. Task 0026 staysactive.