When I execute terraform init
I have the following output :
Initializing modules...
- compute in modules\compute
- private_network in modules\private_network
- public_ip in modules\public_ip
- route in modules\route
Initializing the backend...
Initializing provider plugins...
- Finding terraform-provider-openstack/openstack versions matching "~> 1.35.0"...
- Finding latest version of hashicorp/openstack...
- Installing terraform-provider-openstack/openstack v1.35.0...
- Installed terraform-provider-openstack/openstack v1.35.0 (self-signed, key ID 4F80527A391BEFD2)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/plugins/signing.html
Error: Failed to query available provider packages
Could not retrieve the list of available versions for provider
hashicorp/openstack: provider registry registry.terraform.io does not have a
provider named registry.terraform.io/hashicorp/openstack
And this is my provider.tf file (Inspired from the official Terraform's documentation):
# Define required providers
terraform {
required_version = ">= 0.14.0"
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = "~> 1.35.0"
}
}
}
# Configure the OpenStack Provider
provider "openstack" {
user_name = "username"
tenant_name = "tenantname"
password = "mypasswd"
auth_url = "http://my.openstack.lan:5000"
region = "RegionOne"
}
# Create a web server
#resource "openstack_compute_instance_v2" "test-server" {
# ...
#}
And when I check the version I have this:
Terraform v0.14.2
Your version of Terraform is out of date! The latest version
is 1.0.3. You can update by downloading from https://www.terraform.io/downloads.html
This is when I run terraform apply
Error: Could not load plugin
Plugin reinitialization required. Please run "terraform init".
Plugins are external binaries that Terraform uses to access and manipulate
don't satisfy the version constraints, or are otherwise incompatible.
Terraform automatically discovers provider requirements from your
configuration, including providers used in child modules. To see the
requirements and constraints, run "terraform providers".
2 problems:
- Failed to instantiate provider "registry.terraform.io/hashicorp/openstack"
to obtain schema: unknown provider "registry.terraform.io/hashicorp/openstack"
- Failed to instantiate provider
"registry.terraform.io/terraform-provider-openstack/openstack" to obtain
schema: unknown provider
And finally terraform providers
Providers required by configuration:
.
├── provider[registry.terraform.io/terraform-provider-openstack/openstack] ~> 1.35.0
├── module.compute
│ └── provider[registry.terraform.io/hashicorp/openstack]
├── module.private_network
│ └── provider[registry.terraform.io/hashicorp/openstack]
├── module.public_ip
│ └── provider[registry.terraform.io/hashicorp/openstack]
└── module.route
└── provider[registry.terraform.io/hashicorp/openstack]