feat: expose lambda_architectures and forwarder_use_cache_bucket#109
Conversation
…rder_use_cache_bucket Pass lambda_architectures and forwarder_use_cache_bucket through to the upstream cloudposse/datadog-lambda-forwarder/aws module and add matching wrapper variables. Setting lambda_architectures to ["arm64"] lets consumers run Datadog Forwarder 5.x artifacts, whose native dependencies are built for arm64 and fail on x86_64 with errors such as "No module named 'ujson'" during cold start. lambda_runtime was already wired through. forwarder_use_cache_bucket defaults to true to preserve upstream behavior while letting a stack opt out of creating or using the cache bucket.
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds two new Terraform input variables, ChangesNew module inputs and documentation
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Important Do not edit the Please update the Could you fix it @johncblandii? 🙏 |
There was a problem hiding this comment.
Pull request overview
This PR updates the Terraform wrapper component to expose and pass through two additional inputs—lambda_architectures and forwarder_use_cache_bucket—to the upstream cloudposse/datadog-lambda-forwarder/aws module (v1.10.1), enabling ARM64 forwarder artifacts and explicit cache-bucket control.
Changes:
- Added wrapper variables
lambda_architecturesandforwarder_use_cache_bucketinsrc/variables.tf. - Wired both variables through to the upstream module in
src/main.tf. - Regenerated
README.mdandsrc/README.mdto document the new inputs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/variables.tf | Adds new wrapper inputs for Lambda architecture selection and cache-bucket toggle. |
| src/main.tf | Passes the new inputs through to the upstream datadog_lambda_forwarder module. |
| README.md | Updates Inputs table, but Providers table now shows an installed version instead of the declared constraint. |
| src/README.md | Updates Inputs table, but Providers table now shows an installed version instead of the declared constraint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/variables.tf (1)
31-35: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winConsider adding a
validationblock forlambda_architectures.The description enumerates the only valid values (
["x86_64"],["arm64"]), but nothing enforces this at plan time. A typo like["arm"]would pass through silently to the upstream module.♻️ Proposed validation block
variable "lambda_architectures" { type = list(string) description = "Instruction set architecture for the Datadog Lambda function. Valid values are [\"x86_64\"] and [\"arm64\"]. Set to [\"arm64\"] when using Datadog Forwarder 5.x artifacts." default = null + + validation { + condition = var.lambda_architectures == null || alltrue([for a in var.lambda_architectures : contains(["x86_64", "arm64"], a)]) + error_message = "lambda_architectures must be null or contain only \"x86_64\" and/or \"arm64\"." + } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/variables.tf` around lines 31 - 35, The lambda_architectures variable currently documents only x86_64 and arm64 but does not enforce those values. Add a validation block to the lambda_architectures variable in variables.tf so plan-time input is limited to the allowed architectures, and make sure the check rejects any other string values while allowing null/default behavior to pass through to the upstream module.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/variables.tf`:
- Around line 31-35: The lambda_architectures variable currently documents only
x86_64 and arm64 but does not enforce those values. Add a validation block to
the lambda_architectures variable in variables.tf so plan-time input is limited
to the allowed architectures, and make sure the check rejects any other string
values while allowing null/default behavior to pass through to the upstream
module.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ebe7038d-dc80-4c83-8528-18d9070ddd21
📒 Files selected for processing (4)
README.mdsrc/README.mdsrc/main.tfsrc/variables.tf
… docs and validate lambda_architectures Restore the Providers table to the declared constraint (>= 3.3.0, < 4.0.0) in both READMEs; a prior doc regeneration had pinned it to a concrete local version (3.91.0), making the generated docs non-deterministic. Add a validation block to lambda_architectures so plan-time input is limited to "x86_64" and/or "arm64", while allowing the null default to pass through to the upstream module unchanged.
|
/terratest |
|
There are no real tests for this component. So we set terratest statuses to successful execution without running any tests |
|
These changes were released in v2.2.0. |
Summary
lambda_architecturesandforwarder_use_cache_bucketthrough to the upstreamcloudposse/datadog-lambda-forwarder/awsmodule (pinned at1.10.1), and add matching wrapper variables.lambda_architectures = ["arm64"]. Those artifacts ship native dependencies built for arm64 and fail onx86_64during cold start with errors such asRuntime.ImportModuleError: No module named 'ujson', which silently stops CloudWatch logs from reaching Datadog.forwarder_use_cache_bucket(defaulttrue, preserving upstream behavior).Changes
src/main.tf: forwardlambda_architecturesandforwarder_use_cache_bucketto the upstream module. (lambda_runtimewas already wired through.)src/variables.tf:lambda_architectures—list(string), defaultnull(no change until a stack opts in).forwarder_use_cache_bucket—bool, defaulttrue(matches upstream default).README.md/src/README.md: regenerated Inputs tables to document the new variables.Testing
terraform fmt -check -recursive— cleanterraform validate— Success (only pre-existing, unrelateddatadog_integration_aws_lambda_arndeprecation warnings)1.10.1Notes
Summary by CodeRabbit
New Features
Documentation