Reputation: 75
Terraform v0.14.8
Got this probleme when I try to launch terraform init, the provider registry.terraform.io/hashicorp/aci is not found
I want to use my provider : registry.terraform.io/ciscodevnet/aci
$ terraform providers
Providers required by configuration:
.
├── provider[registry.terraform.io/ciscodevnet/aci] 0.5.4
└── module.bride_domain_2001
└── provider[registry.terraform.io/hashicorp/aci]
My question : How to force registry.terraform.io/ciscodevnet/aci on module ?
How i call my module :
module "bride_domain_2001" {
source = "./modules/bride_domain_2001"
aci_vrf_vrf_training_id= aci_vrf.vrf_training.id
aci_tenant_tenant_training_id= aci_tenant.tenant_training.id
}
Expected Behavior
The in-house provider should be inherited from the parent and used
Actual Behavior
Terraform doesn't use inheritance from parent module
Thanks
Upvotes: 1
Views: 1679
Reputation: 74299
It seems that your child module bride_domain_2001
is missing a required_providers
entry to specify that it depends on ciscodevnet/aci
, which is causing Terraform's backward compatibility behavior to assume you meant hashicorp/aci
.
To fix it, add a required_providers
entry to your child module:
terraform {
required_providers {
aci = {
source = "ciscodevnet/aci"
# (possibly also a >= version constraint)
}
}
}
Once you add this, Terraform will see that the root module and the child module both depend on this same provider ciscodevnet/aci
, and so your configuration for the provider should then be inherited by resources belonging to that provider in the child module.
Upvotes: 0