cloudposse / terraform-aws-datadog-lambda-forwarder

Terraform module to provision all the necessary infrastructure to deploy Datadog Lambda forwarders
https://cloudposse.com/accelerate
Apache License 2.0
18 stars 20 forks source link

Bug on upgrade to v1.6.1 #78

Open edsoncampos-swile opened 2 months ago

edsoncampos-swile commented 2 months ago

Describe the Bug

Hi there 👋 , After upgrading the module to v1.6.1, our logs stopped getting forwarged to Datadog. I found the following error on CloudWatch:

[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': cannot import name 'formatargspec' from 'inspect' (/var/lang/lib/python3.11/inspect.py)

After downgrading, it worked again.

Expected Behavior

Logs getting forwarded to Datadog properly

Steps to Reproduce

Use the module like this:


module "datadog-lambda-forwarder" {
  source                = "cloudposse/datadog-lambda-forwarder/aws"
  version               = "1.6.1"
  forwarder_log_enabled = true

  dd_tags_map = {
    Environment = "production"
  }

  name               = "datadog_log_forwarder_production"
  lambda_memory_size = 1024
  lambda_timeout     = 900
  dd_api_key_source = {
    resource   = "ssm"
    identifier = "[redacted]"
  }

Screenshots

No response

Environment

Additional Context

No response

kylefuhrmanncalm commented 2 weeks ago

Also adding here that python3.7 is no longer a working runtime in some/many AWS regions, so the default on 1.6.0 is failing to deploy and requires using lambda_runtime input to update to a supported, but lower version like python3.9.