We would like to use the count attribute with it but are running into the following error when trying to do so:
Error: Module is incompatible with count, for_each, and depends_on
The module at xxx is a legacy module which contains its own local provider configurations, and so calls to it may not use the count, for_each, or depends_on arguments.
Describe the solution you'd like
As indicated by the error message itself, to be properly reusable the module should ideally not include its own provider configurations. Instead, these should be provided by the caller.
So the solution we'd like to have, would be to remove the following block (lines 11 to 13) from the main.tf file:
provider "aws" {
region = var.region
}
Describe alternatives you've considered
Not using the provided Terraform module and instead creating our own. Would not be our preferred approach, we do not expect this module to be subject to change, but even then not reinventing the wheel remains best practice.
Is your feature request related to a problem? Please describe. Hi there,
we are looking to use the
dynatrace_monitoring_role
Terraform module you are maintaining under aws/role-based-access/terraform-templates/dynatrace_monitoring_role but we can't integrate it to our project the way we'd like because it includes a provider block.We would like to use the
count
attribute with it but are running into the following error when trying to do so:Describe the solution you'd like As indicated by the error message itself, to be properly reusable the module should ideally not include its own provider configurations. Instead, these should be provided by the caller.
So the solution we'd like to have, would be to remove the following block (lines 11 to 13) from the main.tf file:
Describe alternatives you've considered Not using the provided Terraform module and instead creating our own. Would not be our preferred approach, we do not expect this module to be subject to change, but even then not reinventing the wheel remains best practice.