Closed omerls-pw closed 1 year ago
Thanks for opening this issue. The ticket INTMDB-1012 was created for internal tracking.
Hello @omerls-pw
Could you share the required_providers
block used in your configuration?
This is an example of the required_providers
block to use our provider:
terraform {
required_providers {
mongodbatlas = {
source = "mongodb/mongodbatlas"
version = "1.11.0"
}
}
required_version = ">= 1.0"
}
Thanks
I didn't have any. I added it to the code. It looks like this now:
terraform {
required_providers {
mongodbatlas = {
source = "mongodb/mongodbatlas"
version = "~> 1.8"
}
}
}
provider "mongodbatlas" {
private_key = local.mongodb_apikey.privateKey
public_key = local.mongodb_apikey.publicKey
}
but the issue remains:
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/mongodbatlas: provider registry registry.terraform.io does not have a provider named registry.terraform.io/hashicorp/mongodbatlas
│
│ Did you intend to use mongodb/mongodbatlas? If so, you must specify that source address in each module which requires that provider. To see which modules are currently depending on hashicorp/mongodbatlas, run the
│ following command:
│ terraform providers
@omerls-pw How did you solve this for you? I am seeing the same error as shown here with same configuration.
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/mongodbatlas: provider registry registry.terraform.io does not have a provider named
│ registry.terraform.io/hashicorp/mongodbatlas
│
│ Did you intend to use mongodb/mongodbatlas? If so, you must specify that source address in each module which requires that provider. To see which modules are currently depending on
│ hashicorp/mongodbatlas, run the following command:
│ terraform providers
I was using a module which was referencing mongodbatlas
resources & had to add provider reference within the module itself, alongside of the caller module.
@manjitkumar I don't recall but this is my current configuration:
terraform {
required_version = "~> 1.0"
required_providers {
mongodbatlas = {
source = "mongodb/mongodbatlas"
version = "~> 1.8"
}
}
}
provider "mongodbatlas" {
private_key = local.mongodb_apikey.privateKey
public_key = local.mongodb_apikey.publicKey
}
I fixed it by adding the terraform block in the mongo module. It now looks like this:
mongo/main.tf
terraform {
required_providers {
mongodbatlas = {
source = "mongodb/mongodbatlas"
}
}
}
resource "mongodbatlas_project" "app_project" {
name = "MongoProject"
org_id = var.mongodb_atlas_org_id
}
resource "mongodbatlas_cluster" "app_cluster" {
name = "MongoDB-Atlas"
project_id = mongodbatlas_project.app_project.id
provider_instance_size_name = "M0"
provider_name = "AWS"
}
Terraform Configuration File
Steps to Reproduce
raising an error:
Expected Behavior
Download the
provider
codeActual Behavior
Debug Output
Crash Output
Additional Context
References