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

datadog_integration_aws_account error: optional attrs are required #2753

Closed
rjhornsby opened this issue Jan 6, 2025 · 1 comment
Closed
Labels

Comments

@rjhornsby
Copy link
Contributor

Datadog Terraform Provider Version

v3.50.0

Terraform Version

v1.10.2

What resources or data sources are affected?

  • datadog_integration_aws_account

Terraform Configuration Files

resource "datadog_integration_aws_account" "my-aws-datadog" {
  aws_account_id = data.aws_caller_identity.current.account_id
  aws_partition = data.aws_partition.current.partition

  auth_config {
    aws_auth_config_role {
      role_name = aws_iam_role.datadog-forwarder.name
    }
  }

  logs_config {
    lambda_forwarder {
      lambdas = [aws_lambda_function.datadog-forwarder-global.arn]
      sources = ["lambda", "s3"]
    }
  }
  metrics_config {
    automute_enabled          = true
    collect_cloudwatch_alarms = true
    collect_custom_metrics    = true
    enabled                   = true
  }
}

Relevant debug or panic output

 Error: Missing Attribute Configuration
│
│   with module.datadog-aws-forwarder-global.datadog_integration_aws_account.my-aws-datadog,
│   on .terraform/modules/datadog-aws-forwarder-global/dd-forwarder-lambda.tf line 66, in resource "datadog_integration_aws_account" "my-aws-datadog":
│   66: resource "datadog_integration_aws_account" "my-aws-datadog" {
│
│ Exactly one of these attributes must be configured: [aws_regions]
╵
╷
│ Error: Missing Attribute Configuration
│
│   with module.datadog-aws-forwarder-global.datadog_integration_aws_account.my-aws-datadog,
│   on .terraform/modules/datadog-aws-forwarder-global/dd-forwarder-lambda.tf line 66, in resource "datadog_integration_aws_account" "my-aws-datadog":
│   66: resource "datadog_integration_aws_account" "my-aws-datadog" {
│
│ Exactly one of these attributes must be configured: [metrics_config.namespace_filters]
╵
╷
│ Error: Missing Attribute Configuration
│
│   with module.datadog-aws-forwarder-global.datadog_integration_aws_account.my-aws-datadog,
│   on .terraform/modules/datadog-aws-forwarder-global/dd-forwarder-lambda.tf line 66, in resource "datadog_integration_aws_account" "my-aws-datadog":
│   66: resource "datadog_integration_aws_account" "my-aws-datadog" {
│
│ Exactly one of these attributes must be configured: [traces_config.xray_services]

Expected Behavior

The "missing attribute configuration" errors should not be present, since these attrs are listed in the documentation as optional.

  • aws_regions
  • metrics_config.namespace_filters
  • traces_config.xray_services

Actual Behavior

If not explicitly declared in the TF code, the provider throws an error saying that these are required:

  • aws_regions
  • metrics_config.namespace_filters
  • traces_config.xray_services

Steps to Reproduce

terraform plan

Important Factoids

We're not doing anything special, just trying to migrate from the deprecated datadog_integration_aws_lambda_arn

References

GH-2750

@rjhornsby rjhornsby added the bug label Jan 6, 2025
@ktmq
Copy link
Contributor

ktmq commented Jan 10, 2025

Hey @rjhornsby , thanks for reporting this! The docs have been fixed here: #2748

This change went live with the v3.51.0 release 2 days ago, so I'll close this issue.

@ktmq ktmq closed this as completed Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants