terraform-aws-modules / terraform-aws-datadog-forwarders

Terraform module to create resources on AWS to forward logs/metrics to Datadog 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/datadog-forwarders/aws
Apache License 2.0
56 stars 41 forks source link

Again: Unable to import module 'lambda_function': cannot import name '_rand' from 'ddtrace.internal' #30

Closed HyperMe1200 closed 1 year ago

HyperMe1200 commented 1 year ago

Description

Upgraded from 4.1.0 to 5.0.1 and the log forwarding function stopped working. Played with Python version - 3.7 and 3.9 fail, 3.8 works fine. Datadog doc clearly says to use Python 3.8 https://docs.datadoghq.com/logs/guide/forwarder/ "Since version 3.49.0 the Lambda function has been updated to require Python 3.8. If upgrading an older forwarder installation to 3.49.0 or above, ensure the AWS Lambda function is configured to use Python 3.8"

Versions

Reproduction Code [Required]

module "datadog_forwarders" {
  source     = "terraform-aws-modules/datadog-forwarders/aws"
  version    = "5.0.1"

  log_forwarder_name                           = var.name
  create_rds_em_forwarder                      = false
  create_vpc_fl_forwarder                      = false
  dd_api_key_secret_arn                        = data.aws_secretsmanager_secret.datadog_api_key.arn
  kms_alias                                    = aws_kms_alias.datadog.name
  log_forwarder_reserved_concurrent_executions = var.log_forwarder_reserved_concurrent_executions

  tags = var.tags
}

Actual behavior

The function fails with: Runtime.ImportModuleError: Unable to import module 'lambda_function': cannot import name '_rand' from 'ddtrace.internal' (/var/task/ddtrace/internal/__init__.py)

Additional context

Default Python version should be changed to 3.8

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 1 year ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 1 year ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.