oracle-terraform-modules/terraform-oci-iam

Error: Duplicate required providers configuration both on (versions.tf and main.tf) . A module may have only one required providers configuration

brokedba opened this issue · 3 comments

I'm using Terraform v1.0.3 and the modules aren't compatible with a change that appeared in 0.13 already

We now permit at most one required_providers block per module (except for overrides). This prevents users (and Terraform) from struggling to understand how to merge multiple required_providers configurations, with version and source attributes split across multiple blocks.

This is a purposeful change for 0.13. see terraform #issue hashicorp/terraform#25364

you have to make your mind now either keep required_provider clause in version.tf or in the main otherwise this module is useless.

Initializing modules...
Downloading oracle-terraform-modules/iam/oci 2.0.2 for iam_compartment_x...
- iam_compartment_x in .terraform/modules/iam_compartment_x/modules/iam-compartment
There are some problems with the configuration, described below.

The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.
╷
│ Error: Duplicate required providers configuration
│
│   on .terraform/modules/iam_compartment_x/modules/iam-compartment/versions.tf line 2, in terraform:
│    2:   required_providers {
│
│ A module may have only one required providers configuration. The required providers were previously configured at .terraform/modules/iam_compartment_x/modules/iam-compartment/main.tf:5,3-21.
```

Any update on getting this fixed?

Any update on getting this fixed?

@atalakey4work If you just want to use the compartment module , I have a clean/corrected version in my repo that you can use locally .
see folder >> brokedba modules/iam-compartment

@brokedba Thanks, your updated version did the trick!