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

Show Missing Environment Variables Warning when Running Deploy with --package Option #494

Open
ceagan opened this issue Jun 24, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ceagan
Copy link

ceagan commented Jun 24, 2024

Expected Behavior

When performing a deploy from a folder generated by running package separately, and specifying monitors in the configuration, the plugin should ensure that the DATADOG_API_KEY and DATADOG_APP_KEY are in the environment.

Actual Behavior

Because the checks for existence of DATADOG_API_KEY and DATADOG_APP_KEY are in the handler attached to lifecycle events that are not triggered for a deploy executed like this, the validation doesn't occur. This causes the monitors code to fail silently.

if (config.monitorsApiKey !== undefined || config.monitorsAppKey !== undefined) {

Steps to Reproduce the Problem

  1. Use sls package specifying DATADOG_API_KEY and DATADOG_APP_KEY in the environment.
  2. Run sls deploy --package .serverless without specifying DATADOG_API_KEY and DATADOG_APP_KEY in the environment.

Specifications

  • Serverless Framework version: 3.39.0
  • Datadog Serverless Plugin version: 5.66.0
  • Lambda function runtime (Python 3.7, Node 10, etc.): nodejs18.x
@TalUsvyatsky
Copy link

@ceagan, thanks for the report. I was able to reproduce the issue, and I've tracked it on our side.

@TalUsvyatsky TalUsvyatsky added the bug Something isn't working label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants