Skip to content

remove datadog lookup #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 16, 2025
Merged

remove datadog lookup #39

merged 5 commits into from
Jun 16, 2025

Conversation

Benbentwo
Copy link
Contributor

@Benbentwo Benbentwo commented Jun 16, 2025

what

  • Remove hard dependency on datadog_configuration component

why

  • Datadog shouldn't be required.

Summary by CodeRabbit

  • New Features

    • Added the ability to configure the Datadog site via a new variable.
    • Enabled retrieval of Datadog API and App keys from AWS SSM Parameter Store when specified.
  • Chores

    • Removed dependency on an external Datadog configuration module.

Copy link

coderabbitai bot commented Jun 16, 2025

Walkthrough

This update modifies how Datadog API and App keys are managed in Terraform. It introduces new variables for SSM parameter names and the Datadog site, adds conditional data sources for retrieving keys from AWS SSM Parameter Store, and removes the external Datadog configuration module. Key references are updated to use these new data sources and variables.

Changes

File(s) Change Summary
src/datadog-agent.tf Added variables for SSM parameter names and Datadog site; added conditional SSM data sources; updated key and site references to use new variables/data sources.
src/remote-state.tf Removed the datadog_configuration module sourcing Datadog credentials from an external repository.

Sequence Diagram(s)

sequenceDiagram
    participant Terraform
    participant AWS SSM
    participant Datadog Agent Sidecar

    Terraform->>AWS SSM: Retrieve datadog_api_key (if SSM parameter name provided)
    Terraform->>AWS SSM: Retrieve datadog_app_key (if SSM parameter name provided)
    Terraform->>Datadog Agent Sidecar: Pass API key and site from SSM/variable
Loading

Possibly related PRs

Poem

In the code-burrow, secrets now hide,
SSM keeps the Datadog keys inside.
No more modules fetched from afar,
Variables and data sources raise the bar.
With a hop and a skip, the site’s now set—
This rabbit’s work is the best one yet! 🐇✨


📜 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 1619273 and 2a14237.

📒 Files selected for processing (1)
  • src/datadog-agent.tf (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/datadog-agent.tf
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Summary

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mergify mergify bot requested review from a team June 16, 2025 19:15
Copy link

mergify bot commented Jun 16, 2025

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 @Benbentwo? 🙏

@mergify mergify bot added the triage Needs triage label Jun 16, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (1)
src/datadog-agent.tf (1)

69-82: Guard SSM lookup in FireLens configuration

Unconditionally using one(data.aws_ssm_parameter.datadog_api_key[*].value) when datadog_agent_sidecar_enabled may cause errors if the SSM param name is null or incorrect.
Wrap the one(...) call in a conditional that also checks the data source count or validate the input earlier.

🧹 Nitpick comments (1)
src/datadog-agent.tf (1)

119-122: Map environment variables for Datadog API key and site

You’ve updated DD_API_KEY and DD_SITE correctly. Consider also mapping the App key (if required) to an environment variable like DD_APP_KEY.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f4585c9 and 8071c80.

📒 Files selected for processing (6)
  • src/README.md (0 hunks)
  • src/cloud-map.tf (2 hunks)
  • src/context.tf (1 hunks)
  • src/datadog-agent.tf (7 hunks)
  • src/main.tf (6 hunks)
  • src/remote-state.tf (10 hunks)
💤 Files with no reviewable changes (1)
  • src/README.md
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: component / terraform / Lint (./src)
  • GitHub Check: Summary
🔇 Additional comments (9)
src/context.tf (1)

267-268: Formatting only: indentation adjustment in descriptor_formats description

The indentation of format and labels has been updated for consistency without changing behavior.

src/main.tf (1)

86-87: Module version downgrades

Multiple Cloud Posse modules (cloudwatch-logs, ecs-container-definition, ecs-alb-service-task, alb-ingress, ecs-cloudwatch-autoscaling, ecs-cloudwatch-sns-alarms) have been pinned to earlier versions for alignment. No functional changes were introduced.
Ensure terraform init and terraform plan succeed and verify compatibility across your stack.

Also applies to: 185-186, 257-258, 345-346, 446-447, 478-479

src/cloud-map.tf (1)

7-7: Downgraded remote-state module version to 1.5.0

The cloudposse/stack-config/yaml//modules/remote-state source has been reverted to 1.5.0 in both namespace and service discovery blocks. Confirm there are no breaking changes from the previous 1.8.0.

Also applies to: 28-28

src/remote-state.tf (1)

57-59: Uniform remote-state module downgrades to 1.5.0

Across multiple components (vpc, security_group, rds, ecs_cluster, alb, nlb, s3, service_domain, iam_role, efs), the version of cloudposse/stack-config/yaml//modules/remote-state has been rolled back from 1.8.0 to 1.5.0. Please validate remote-state initialization and outputs after this change.

Also applies to: 68-70, 78-80, 86-88, 95-97, 106-109, 116-118, 128-131, 164-167, 176-179

src/datadog-agent.tf (5)

25-29: Add variable for Datadog site

The datadog_site variable (default "us5.datadoghq.com") is introduced correctly. No issues observed.


49-53: SSM parameter data sources

The aws_ssm_parameter data blocks for both API and App keys are correctly gated on the presence of variable values and sidecar enablement.

Also applies to: 55-59


85-88: Module version pin for sidecar logs

Downgraded cloudposse/cloudwatch-logs/aws to 0.6.6. This aligns with other version changes and does not affect core logic.


107-110: Module version pin for Datadog agent container

The Datadog agent container definition has been downgraded to 0.58.1. Looks good.


155-158: Module version pin for Fluent Bit container

Downgraded ecs-container-definition/aws to 0.58.1 for the Fluent Bit router. All good.

@mergify mergify bot added the needs-test Needs testing label Jun 16, 2025
@Benbentwo Benbentwo enabled auto-merge June 16, 2025 19:29
@goruha goruha added the major Breaking changes (or first stable release) label Jun 16, 2025
@Benbentwo Benbentwo added this pull request to the merge queue Jun 16, 2025
@mergify mergify bot removed the triage Needs triage label Jun 16, 2025
Merged via the queue into main with commit 6b371e7 Jun 16, 2025
14 checks passed
@Benbentwo Benbentwo deleted the feature/disable-need-for-dd branch June 16, 2025 19:35
Copy link

These changes were released in v2.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Breaking changes (or first stable release) needs-test Needs testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants