Skip to content

Conversation

@ivan-pinatti
Copy link

@ivan-pinatti ivan-pinatti commented Oct 3, 2025

what

Introduce a new variable to have a fine-grained control about the type of S3 Events to trigger the Lambda Notification.

Requires change in underlying Terraform module to be applied first; cloudposse/terraform-aws-datadog-lambda-forwarder#105

why

Default should capture all the Create and Removal events (safer and more compreensive)
AND the variable would provide flexibility to include / remove as needed by users.

references

Summary by CodeRabbit

  • New Features
    • Added ability to configure which S3 events trigger Datadog Lambda Forwarder notifications, giving fine-grained control over event handling.
    • Exposed a user-configurable list of S3 events (optional, defaults to none) so deployments can opt in to specific event types.

…cation AND set the default to ObjectCreated + ObjectRemoved
@coderabbitai
Copy link

coderabbitai bot commented Oct 3, 2025

Walkthrough

Adds a new Terraform variable s3_notification_events (list(string)) and wires it into module "datadog_lambda_forwarder" in src/main.tf by passing s3_notification_events = var.s3_notification_events.

Changes

Cohort / File(s) Change Summary
Terraform variable added
src/variables.tf
Introduced variable "s3_notification_events" { type = list(string) description = "List of S3 events to trigger the Lambda notification" default = [] }.
Module input propagation
src/main.tf
Passed the new variable into the Datadog forwarder module: s3_notification_events = var.s3_notification_events.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer/Terraform
  participant TF as Terraform config
  participant Mod as datadog_lambda_forwarder module
  participant Lambda as Lambda (forwarder)

  Dev->>TF: set var.s3_notification_events
  TF->>Mod: s3_notification_events = var.s3_notification_events
  Mod->>Lambda: configure S3 event triggers (list of events)
  note right of Lambda #D6EAF8: Lambda receives configured\nS3 notifications via module
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nibble at configs, ears alert and bright,
New S3 hops into the night.
Forwarder listens, ready to relay,
Buckets sing and events find their way.
Tiny paws commit — deploy takes flight. 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Finer Controls for S3 Events Notifications" directly and clearly summarizes the main change in this pull request. The PR introduces a new configurable variable s3_notification_events that allows users to specify which S3 event types trigger Lambda notifications, which is precisely what "finer controls" for S3 event notifications means. The title is concise, specific, and avoids vague language or unnecessary noise. A teammate reviewing the commit history would immediately understand that this PR enables more granular control over S3 events for Lambda notifications.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e6a62d and 09540c9.

📒 Files selected for processing (2)
  • src/main.tf (1 hunks)
  • src/variables.tf (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main.tf
🧰 Additional context used
📓 Path-based instructions (2)
src/{main,variables,outputs,providers,versions,context}.tf

📄 CodeRabbit inference engine (AGENTS.md)

Keep the Terraform component files in src/: main.tf, variables.tf, outputs.tf, providers.tf, versions.tf, context.tf (source of truth)

Files:

  • src/variables.tf
src/**/*.tf

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.tf: Use 2-space indentation for Terraform files
In Terraform, use lower_snake_case for variables and locals
Keep resource and data source names descriptive and aligned with Cloud Posse null-label patterns
Run terraform fmt and commit only formatted Terraform code
Adhere to TFLint rules defined in .tflint.hcl; do not commit lint violations

Files:

  • src/variables.tf
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (1)
src/variables.tf (1)

103-107: New S3 events variable looks good.

The variable is properly defined with consistent formatting, correct naming convention, and logical placement near related S3 bucket variables. The empty list default aligns with the past review feedback and allows the upstream module to apply its defaults when the variable is not explicitly set.

Please verify that this variable is correctly passed into the datadog_lambda_forwarder module in src/main.tf (as mentioned in the AI summary). Specifically, confirm that s3_notification_events = var.s3_notification_events is present in the module block. You can share the relevant section of main.tf for confirmation if needed.


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 and usage tips.

@mergify mergify bot requested review from a team October 3, 2025 16:32
@mergify mergify bot added the triage Needs triage label Oct 3, 2025
@goruha
Copy link
Contributor

goruha commented Oct 14, 2025

@ivan-pinatti could you pls update the module version to https://github.com/cloudposse/terraform-aws-datadog-lambda-forwarder/releases/tag/v1.10.0

@ivan-pinatti
Copy link
Author

@mergify mergify bot added the needs-test Needs testing label Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-test Needs testing triage Needs triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants