Loading...
Loading...
### Terraform Version ```shell `Terraform v1.11.3` ``` ### Terraform Configuration Files ```terraform resource ... { ... provider = var.project_name == "xxx" ? aws.aws_no_defaults : aws.aws } ``` ### Debug Output ``` │ Error: Invalid provider configuration reference │ │ on modules/private-cloud/rds.tf line 321, in resource "aws_kms_key" "rds": │ 321: provider = var.project_name == "essentials" ? aws.aws_no_defaults : aws.aws │ │ The provider argument requires a provider type name, optionally followed by a period and then a configuration │ alias. ``` ### Expected Behavior It should be documented https://developer.hashicorp.com/terraform/language/providers/configuration#default-provider-configurations how to use different providers for the same resource. ### Actual Behavior TF does not allow to use default provider conditionally ### Steps to Reproduce 1. Create two clusters 2. Depending on the project name this resource should use one or another provider In our case we are trying to merge two separate projects together into a single TF configuration. Before we used two separate configurations and this resource uses different providers. But when TF config was merged it seems not possible to tell TF to apply the provider conditionally. ### Additional Context _No response_ ### References _No response_ ### Generative AI / LLM assisted development? _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.