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

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

Closed
brokedba opened this issue Feb 5, 2023 · 3 comments · Fixed by #31

Comments

@brokedba
Copy link

brokedba commented Feb 5, 2023

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.
```
@atalakey4work
Copy link

Any update on getting this fixed?

@brokedba
Copy link
Author

brokedba commented Mar 1, 2023

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

@ahmedmansour5
Copy link

@brokedba Thanks, your updated version did the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants