`provider registry registry.terraform.io does not have a provider named registry.terraform.io/hashicorp/kubectl`.
BeginnerTroubleshootingDependencies, Cycles and Providers
Answer
Likely causes → A non-HashiCorp provider is used without a source in required_providers, so Terraform assumes hashicorp/<name>. Often happens in a child module that forgot to declare it.
Diagnose → The error says Did you intend to use ...? and names the module requiring it.
Fix → In every module that uses it:
terraform {
required_providers {
kubectl = {
source = "alekc/kubectl"
version = "~> 2.0"
}
}
}
Prevent → Every module declares all its providers with source; tflint catches missing ones.
More on Dependencies, Cycles and Providers
`Error: Cycle: aws_security_group.app, aws_security_group.db`.Beginner`Error: Cycle: local.name_prefix, local.tags`.BeginnerA cycle appears only after adding `depends_on = [module.app]` to a module. The error lists dozens of nodes.IntermediateAdding `create_before_destroy = true` to a launch template causes `Error: Cycle: ... (destroy deposed ...)`.Advanced`terraform init` fails: `Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints ~> 4.0, >= 5.30.0`.Intermediate`Error: Inconsistent dependency lock file` with `locked version selection 5.31.0 doesn't match the updated version constraints ">= 5.40.0"`.Beginner