Skip to content
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

support nested DD_API_KEY secret in lambda forwarder #851

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

r0fls
Copy link
Contributor

@r0fls r0fls commented Sep 25, 2024

What does this PR do?

Adds support for nested DD_API_KEY in AWS SecretsManager.

Motivation

It is common for organizations and individuals to store this in a shared dictionary with other secrets in AWS, which is not currently supported.

Testing Guidelines

Additional Notes

Types of changes

  • New feature

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)
  • This PR passes the unit tests
  • This PR passes the installation tests (ask a Datadog member to run the tests)

@r0fls r0fls requested a review from a team as a code owner September 25, 2024 18:30
@ge0Aja
Copy link
Contributor

ge0Aja commented Sep 30, 2024

please run python -m black aws/logs_monitoring/settings.py to fix the formatting.

"Successfully retrieved the Datadog API key from 'DD_API_KEY'."
)
else:
raise ValueError("The secret does not contain the 'DD_API_KEY' field.")
Copy link
Contributor

@ge0Aja ge0Aja Oct 1, 2024

Choose a reason for hiding this comment

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

Just noticed raising a ValueError here is not properly handled down stream and will lead to an uncaught exception.
I suggest to handle it or simply log an error as we'd still have the DD_API_KEY set to the default value <YOUR_DATADOG_API_KEY> which won't work anw

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, sorry for the delay. Sounds good, updating.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, lmk if that looks good

@ge0Aja ge0Aja self-assigned this Oct 3, 2024
Copy link
Contributor

@ge0Aja ge0Aja left a comment

Choose a reason for hiding this comment

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

lgtm

@ge0Aja ge0Aja merged commit af175ef into DataDog:master Oct 3, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants