terraformterraform-provider

Terraform Problem to define cyrilgdn/postgresql provider properly


I have the exact same problem as here Terraform tries to load old defunct provider and the solution posted there does not work for me.

Problem is that i define in the terraform config:

required_providers {
    postgresql = {
        source  = "cyrilgdn/postgresql"
        version = ">=1.13.0"
    }
}

But the terraform init process always tries to download hashicorp/postgresql and can not find it in the end.

My current terraform version is:

Terraform v1.0.6 on windows_amd64

I did try a lot and played around with the resource parameter "provider" to explicitly set the provider for all resources but even with that i did not find a way.

Can anybody help here again or post me a working example for this provider?


Solution

  • I got the solution! The problem what i had was my folder structure. I had a specific folder structure like:

    environments like dev/int/prod and i had a config.tf in there with the required providers.

    resources where i use the resources i want to add and what i missed there is the a copy of the config.tf file.

    So this means i need a config.tf file in every subfolder which consists modules.