Closed sonic1981 closed 3 years ago
@sonic1981 we are using the new path and were an earlier mover when the registry change came out. This move meant all verified providers had to move from Hashicorp's repository (terraform-providers/mongodbatlas) to the providers own repository (mongodb/terraform-provider-mongodbatlas - where this issue is). It looks like you may have both perhaps cached locally? @nikhil-mongo can you try to repo this and see and assist?
Hey @themantissa
If I delete the .terraform
folder and the lock file and run init I can still see it using the terraform-providers/mongodbatlas
. If it is cached, I'm not sure where from or how to remove that?
Here's the output from the init
call on a clean directory:
Initializing the backend...
Successfully configured the backend "azurerm"! Terraform will automatically
use this backend unless the backend configuration changes.
Initializing provider plugins...
- Finding latest version of hashicorp/random...
- Finding latest version of hashicorp/template...
- Finding latest version of terraform-providers/mongodbatlas...
- Finding hashicorp/azurerm versions matching "2.44.0"...
- Finding mongodb/mongodbatlas versions matching "0.8.0"...
- Installing hashicorp/random v3.0.1...
- Installed hashicorp/random v3.0.1 (signed by HashiCorp)
- Installing hashicorp/template v2.2.0...
- Installed hashicorp/template v2.2.0 (signed by HashiCorp)
- Installing terraform-providers/mongodbatlas v0.8.1...
- Installed terraform-providers/mongodbatlas v0.8.1 (signed by HashiCorp)
- Installing hashicorp/azurerm v2.44.0...
- Installed hashicorp/azurerm v2.44.0 (signed by HashiCorp)
- Installing mongodb/mongodbatlas v0.8.0...
- Installed mongodb/mongodbatlas v0.8.0 (signed by a HashiCorp partner, key ID 2A32ED1F3AD25ABF)
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
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.
Warning: Additional provider information from registry
The remote registry returned warnings for
registry.terraform.io/terraform-providers/mongodbatlas:
- For users on Terraform 0.13 or greater, this provider has moved to
mongodb/mongodbatlas. Please update your source in required_providers.
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
@sonic1981 I am currently working on this and will update you on our findings.
I'm going to try tearing down everything and deleting the state to see what happens if I configure that provider from the off
so if I completely delete the .tfstate
and run init
my providers looks like:
Providers required by configuration:
.
├── provider[registry.terraform.io/hashicorp/random]
├── provider[registry.terraform.io/hashicorp/azurerm] 2.44.0
├── provider[registry.terraform.io/mongodb/mongodbatlas] 0.8.0
├── module.takeapi
│ └── provider[registry.terraform.io/hashicorp/azurerm]
├── module.kv
│ └── provider[registry.terraform.io/hashicorp/azurerm]
├── module.list
│ └── provider[registry.terraform.io/hashicorp/azurerm]
├── module.compare
│ └── provider[registry.terraform.io/hashicorp/azurerm]
├── module.dashboards
│ ├── provider[registry.terraform.io/hashicorp/azurerm]
│ └── provider[registry.terraform.io/hashicorp/template]
├── module.take
│ └── provider[registry.terraform.io/hashicorp/azurerm]
├── module.process
│ └── provider[registry.terraform.io/hashicorp/azurerm]
├── module.sche
│ └── provider[registry.terraform.io/hashicorp/azurerm]
├── module.dl
│ └── provider[registry.terraform.io/hashicorp/azurerm]
└── module.mongo
└── provider[registry.terraform.io/mongodb/mongodbatlas] 0.8.0
so it seems it's the state file that isn't changing the provider from terraform-providers/mongodbatlas
to mongodb/mongodbatlas
. Not sure if this is a provider issue or a terraform (core) issue?
@nikhil-mongo looking at the docs for terraform, I think this is a terraform issue, not a provider issue. according to this doc I'd expect the resources for the old provider to be torn down and recreated with the new provider:
This is seamless when changing a resource's attributes, but Terraform will lose track of a resource if you change its name, move it to a different module, or change its provider.
Usually that's fine: Terraform will destroy the old resource, replace it with a new one (using the new resource address), and update any resources that rely on its attributes.
I'll raise an issue on the main terraform github
Closing as it seems this is core terraform functionality and not the provider
Terraform CLI and Terraform MongoDB Atlas Provider Version
Terraform Configuration File
Steps to Reproduce
I recently upgraded terraform from 0.13 to 0.14. Upon doing this I got an error message:
My configuation file was at the time:
I updated the source as requested to:
Expected Behavior
Provider should be using the
mongodb/mongodbatlas
provider and not theregistry.terraform.io/terraform-providers/mongodbatlas
.Actual Behavior
I still get the error message despite changing the source.
Debug Output
terraform providers
output:Terraform lock file:
Crash Output
Additional Context
References