Intro
This KB is dedicated to resolve Terraform Cli issue with plugin version incompatibility
Problem description
Terraform is returning error
Error: provider.external: Incompatible API version with plugin. Plugin version: 5, Core version: 4
on the
terraform init
This happens because Terraform - Plugins API version of the plugin is higher than current Terraform Cli supports.
Terraform Cli plugins released after Terraform Cli version release can be not compatible with older terraform versions.
Solution
The best is to Upgrade Terraform Cli version following Terraform Upgrade guides. So newer plugin is compatible with Terraform Cli version.
As quick fix temporary alternative you can add provider version definition which downgrades plugin version to compatible one.
Add to the main.tf:
provider "external" {
version "< 2.1.0"
}
Perform
terraform init