scribd / terraform-aws-datadog

Terraform module for setting up AWS Datadog integration
https://registry.terraform.io/modules/scribd/datadog/aws/1.0.0
MIT License
38 stars 30 forks source link

extra_policy_arns: Document module variable in README.md #52

Open paulmscribd opened 1 year ago

paulmscribd commented 1 year ago

Added in an August, 2021 change, the extra_policy_arns module variable offers one way to support the optional Datadog / AWS CloudTrail integration.

The implementation's use of for_each may, however, lead to errors of the form:

│ Error: Invalid for_each argument
[...]
│  NNN:   for_each   = toset(var.extra_policy_arns)
│     ├────────────────
│     │ var.extra_policy_arns is list of string with 1 element
│ 
│ The "for_each" value depends on resource attributes that cannot be determined
│ until apply, so Terraform cannot predict how many instances will be created.
│ To work around this, use the -target argument to first apply only the
│ resources that the for_each depends on.

which I think we should alert users to.