How can I enable active tracing by default for an AWS Lambda function using Terraform?
This looks like it was added to Terraform back in May 2017, you enable it with the tracing_config block:

tracing_config {
  mode = "Active"
}


You will also need to make sure that Terraform has a minimum of Write access to X-ray to enable the above to work:

data "aws_iam_policy" "aws_xray_write_only_access" {
  arn = "arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess"
}