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 40 forks source link

Error: cannot import name '_rand' with latest module version #32

Closed berniedurfee-renaissance closed 1 year ago

berniedurfee-renaissance commented 1 year ago

Description

Please provide a clear and concise description of the issue you are encountering, and a reproduction of your configuration (see the examples/* directory for references that you can copy+paste and tailor to match your configs if you are unable to copy your exact configuration). The reproduction MUST be executable by running terraform init && terraform apply without any further changes.

If your request is for a new feature, please use the Feature request template.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

Reproduction Code [Required]

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

  kms_alias             = "alias/datadog"
  dd_api_key_secret_arn = data.aws_secretsmanager_secret_version.datadog_api_key.arn

  create_log_forwarder    = true
  create_rds_em_forwarder = true
  create_vpc_fl_forwarder = false

  vpc_id = "XXXXX"
}

Steps to reproduce the behavior:

terraform apply

Expected behavior

The log forwarder should be created and should forward logs

Actual behavior

Log forwarder throws error:

[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': cannot import name '_rand' from 'ddtrace.internal' (/var/task/ddtrace/internal/__init__.py)
Traceback (most recent call last):
berniedurfee-renaissance commented 1 year ago

I did see the other issues, but they looked like they'd been fixed, so maybe this is a regression?

a296Cg commented 1 year ago

I just ran into this same issue, it looks like the issue is the default runtime should be python3.8, not 3.9.

see: https://github.com/DataDog/datadog-serverless-functions/issues/611

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.