akshaykarle / terraform-provider-mongodbatlas

Terraform provider for MongoDB Atlas
Mozilla Public License 2.0
123 stars 54 forks source link

Provider "mongodbatlas" not available for installation. #73

Open abramovi opened 5 years ago

abramovi commented 5 years ago

Hi ,

I am trying to use this provider following the example folder, but when I ran terraform init, i am getting - Provider "mongodbatlas" not available for installation.

Any idea ?

Knappek commented 5 years ago

@abramovi have you installed the provider? Check the Readme for installation guide, it's basically about downloading the binary from the release page and putting it into ~/.terraform.d/plugins

Sent with GitHawk

gschaffer-cxn commented 5 years ago

We are experiencing the same issues. Downloaded the binary, put in into ~/.terraform.d/plugins and .../pluginslinux_amd64/ and get the same error. :(

The weird thing is that according to DEBUG log it appears to find the plugin, but still want to download it from releases.terraform.

-----------------------------------------------------
2019/03/07 10:44:54 [DEBUG] [aws-sdk-go] 
2019/03/07 10:44:54 [DEBUG] checking for provider in "."
2019/03/07 10:44:55 [DEBUG] checking for provider in "/usr/bin"
2019/03/07 10:44:55 [DEBUG] checking for provider in ".terraform/plugins/linux_amd64"
2019/03/07 10:44:55 [DEBUG] found provider "terraform-provider-aws_v2.0.0_x4"
2019/03/07 10:44:55 [DEBUG] found provider "terraform-provider-template_v2.1.0_x4"
2019/03/07 10:44:55 [DEBUG] checking for provider in "/home/gschaffer/.terraform.d/plugins"
2019/03/07 10:44:55 [DEBUG] checking for provider in "/home/gschaffer/.terraform.d/plugins/linux_amd64"
2019/03/07 10:44:55 [DEBUG] found provider "terraform-provider-mongodbatlas_v0.8.1_linux_amd64"
2019/03/07 10:44:55 [DEBUG] found valid plugin: "template", "2.1.0", "/home/gschaffer/repos/cxn/terraform-infra/aws/cxn-prod-eu-west-1/prod-vpc01/services/license-server/.terraform/plugins/linux_amd64/terraform-provider-template_v2.1.0_x4"
2019/03/07 10:44:55 [DEBUG] found valid plugin: "aws", "2.0.0", "/home/gschaffer/repos/cxn/terraform-infra/aws/cxn-prod-eu-west-1/prod-vpc01/services/license-server/.terraform/plugins/linux_amd64/terraform-provider-aws_v2.0.0_x4"
2019/03/07 10:44:55 [DEBUG] plugin requirements: "aws"=""
2019/03/07 10:44:55 [DEBUG] plugin requirements: "mongodbatlas"=""
2019/03/07 10:44:55 [DEBUG] plugin requirements: "template"=""

Initializing provider plugins...
- Checking for available provider plugins on https://releases.hashicorp.com...
2019/03/07 10:44:55 [ERROR] failed to fetch plugin versions from https://releases.hashicorp.com/terraform-provider-mongodbatlas/
403 Forbidden
<html>
<head><title>403 Forbidden</title></head>
<body>
<h1>403 Forbidden</h1>
<ul>
<li>Code: AccessDenied</li>
<li>Message: Access Denied</li>
<li>RequestId: FCC9B7B4C1FE05E3</li>
<li>HostId: NNgLgnTDseSnIeVPfj3G0jq6lviMIsdDgtNSNBA7MZV+PvvtJYLOtr7s0TARItaoE3PlcytvN24=</li>
</ul>
<hr/>
</body>
</html>
2019/03/07 10:44:55 [ERROR] 1 error(s) occurred:

* no provider exists with the given name
2019/03/07 10:44:55 [DEBUG] plugin: waiting for all plugin processes to complete...

Provider "mongodbatlas" not available for installation.

A provider named "mongodbatlas" could not be found in the official repository.

This may result from mistyping the provider name, or the given provider may
be a third-party provider that cannot be installed automatically.

In the latter case, the plugin must be installed manually by locating and
downloading a suitable distribution package and placing the plugin's executable
file in the following directory:
    terraform.d/plugins/linux_amd64

Terraform detects necessary plugins by inspecting the configuration and state.
To view the provider versions requested by each module, run
"terraform providers".
Knappek commented 5 years ago

I'm currently not on my computer so I can't reproduce it, but I guess the filename is not correct, you have to remove the "_linux_amd64" according to the naming scheme: https://www.terraform.io/docs/configuration/providers.html#third-party-plugins

Sent with GitHawk

christianuhlcc commented 5 years ago

Hi @Knappek we just experienced this issue and renaming (removing "_linux_amd64" ) helps, plugin is installed correctly

gschaffer-cxn commented 5 years ago

That fixed it for me aswell, thanks

Knappek commented 5 years ago

@akshaykarle you can close this issue.

Sent with GitHawk

christianuhlcc commented 5 years ago

@Knappek I would leave it open for a follow-up PR that fixes the actual issue - that the name of the compiled binary is not suitable for installation, otherwise every new user needs to find this closed issue to install it, right?

I can try to propose a PR, but I am horrible at go, so I for sure need some help.

Knappek commented 5 years ago

@christianuhlcc I don't think this is possible as you need to differentiate between the different operating systems...it's quite common that you need to rename binaries that you download from the web. What you can do though is enhancing the Readme maybe...

Sent with GitHawk

gschaffer-cxn commented 5 years ago

@Knappek the same issue exists within the zipped releases, we could at least fix those along with the README

christianuhlcc commented 5 years ago

I looked around how other community providers handle it, and everybody does it differently ...

Maybe only serving ZIP files with the target system in the name, and the containing file in the usable filename would be the way to go? That would make it obvious for downloaders and easy for installers to do the right thing.

akshaykarle commented 5 years ago

hey all, thanks for all the inputs. I will update the readme with instructions to rename the binaries to avoid confusion.

nitrag commented 5 years ago

This was my first 3rd party plugin, phew complicated.

#for OSX
wget -O ~/.terraform.d/plugins/terraform-provider-mongodbatlas_v1.1.0 https://github.com/akshaykarle/terraform-provider-mongodbatlas/releases/download/v1.1.0/terraform-provider-mongodbatlas_v1.1.0_darwin_amd64
petr-nazarov commented 3 years ago

This worked for me, adding the following lines before using any resources:

terraform {
  required_providers {
    mongodbatlas = {
      source  = "mongodb/mongodbatlas"
      version = "0.9.1"
    }
  }
}

provider "mongodbatlas" {
  public_key  = var.mongodb_atlass_public_key
  private_key = var.mongodb_atlass_private_key
}