Skip to content

feat: expose lambda_architectures and forwarder_use_cache_bucket#109

Merged
johncblandii merged 2 commits into
mainfrom
feat/pp-107-datadog-forwarder-wrapper
Jul 7, 2026
Merged

feat: expose lambda_architectures and forwarder_use_cache_bucket#109
johncblandii merged 2 commits into
mainfrom
feat/pp-107-datadog-forwarder-wrapper

Conversation

@johncblandii

@johncblandii johncblandii commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Pass lambda_architectures and forwarder_use_cache_bucket through to the upstream cloudposse/datadog-lambda-forwarder/aws module (pinned at 1.10.1), and add matching wrapper variables.
  • Enables consumers to run Datadog Forwarder 5.x artifacts by setting lambda_architectures = ["arm64"]. Those artifacts ship native dependencies built for arm64 and fail on x86_64 during cold start with errors such as Runtime.ImportModuleError: No module named 'ujson', which silently stops CloudWatch logs from reaching Datadog.
  • Lets a stack explicitly control the forwarder cache bucket via forwarder_use_cache_bucket (default true, preserving upstream behavior).

Changes

  • src/main.tf: forward lambda_architectures and forwarder_use_cache_bucket to the upstream module. (lambda_runtime was already wired through.)
  • src/variables.tf:
    • lambda_architectureslist(string), default null (no change until a stack opts in).
    • forwarder_use_cache_bucketbool, default true (matches upstream default).
  • README.md / src/README.md: regenerated Inputs tables to document the new variables.

Testing

  • terraform fmt -check -recursive — clean
  • terraform validate — Success (only pre-existing, unrelated datadog_integration_aws_lambda_arn deprecation warnings)
  • Verified both variables exist with matching type/default in upstream module 1.10.1

Notes

  • Both defaults are chosen to be no-ops, so existing stacks are unaffected until they explicitly set the new variables.
  • Upstreams wrapper changes originally made downstream by Prezzee.

Summary by CodeRabbit

  • New Features

    • Added support for configuring Lambda architecture options.
    • Added a new setting to enable or disable use of a cache bucket.
  • Documentation

    • Updated the setup docs with the latest supported provider version.
    • Documented the new configuration options and their defaults.

…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.
Copilot AI review requested due to automatic review settings July 7, 2026 14:32
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@johncblandii, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 34eca966-7cda-4a5a-903b-08f49caded4b

📥 Commits

Reviewing files that changed from the base of the PR and between b6a1098 and 1bba75c.

📒 Files selected for processing (3)
  • README.md
  • src/README.md
  • src/variables.tf
📝 Walkthrough

Walkthrough

Adds two new Terraform input variables, lambda_architectures and forwarder_use_cache_bucket, wires them into the datadog_lambda_forwarder module call, pins the datadog provider to version 3.91.0, and updates root and src README documentation accordingly.

Changes

New module inputs and documentation

Layer / File(s) Summary
Variable definitions and module wiring
src/variables.tf, src/main.tf
Adds lambda_architectures (list(string), default null) and forwarder_use_cache_bucket (bool, default true) variables and passes them as arguments to the datadog_lambda_forwarder module.
Documentation updates
README.md, src/README.md
Pins the datadog provider version to 3.91.0 and documents the two new input variables in both README files.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested labels: needs-test

Suggested reviewers: osterman, RoseSecurity, Gowiem

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: exposing the two new module variables.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pp-107-datadog-forwarder-wrapper

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify mergify Bot requested review from a team July 7, 2026 14:33
@mergify

mergify Bot commented Jul 7, 2026

Copy link
Copy Markdown

Important

Do not edit the README.md directly. It's auto-generated from the README.yaml

Please update the README.yaml file instead.

Could you fix it @johncblandii? 🙏

@mergify mergify Bot added the triage Needs triage label Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_architectures and forwarder_use_cache_bucket in src/variables.tf.
  • Wired both variables through to the upstream module in src/main.tf.
  • Regenerated README.md and src/README.md to 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.

Comment thread README.md Outdated
Comment thread src/README.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/variables.tf (1)

31-35: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Consider adding a validation block for lambda_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

📥 Commits

Reviewing files that changed from the base of the PR and between b0b9fb4 and b6a1098.

📒 Files selected for processing (4)
  • README.md
  • src/README.md
  • src/main.tf
  • src/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.
@mergify mergify Bot added the needs-test Needs testing label Jul 7, 2026
@johncblandii

Copy link
Copy Markdown
Contributor Author

/terratest

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

There are no real tests for this component. So we set terratest statuses to successful execution without running any tests

@mergify mergify Bot removed the triage Needs triage label Jul 7, 2026
@mergify mergify Bot requested a review from a team July 7, 2026 15:52
@johncblandii johncblandii added this pull request to the merge queue Jul 7, 2026
Merged via the queue into main with commit 4109526 Jul 7, 2026
19 checks passed
@johncblandii johncblandii deleted the feat/pp-107-datadog-forwarder-wrapper branch July 7, 2026 16:06
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

These changes were released in v2.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-test Needs testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants