terraform-provider-conjur icon indicating copy to clipboard operation
terraform-provider-conjur copied to clipboard

Manifest example in provider's documentation is wrong.

Open JfcAtCyberArk opened this issue 4 years ago • 6 comments

Summary

Manifest example in provider's documentation is wrong.

Expected Results

The provider name should be "cyberark/conjur".

Actual Results (including error logs, if applicable)

The provider name is "conjur" and terraform init fails with the below:

Initializing the backend...

Initializing provider plugins...
- Checking for available provider plugins...

Provider "conjur" not available for installation.

A provider named "conjur" could not be found in the Terraform Registry.

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".


Error: no provider exists with the given name


ERROR: 1

Reproducible

  • [x] Always
  • [ ] Sometimes
  • [ ] Non-Reproducible

JfcAtCyberArk avatar Sep 08 '21 06:09 JfcAtCyberArk

Thanks for the submission! We'll take a look as soon as we're able.

jtuttle avatar Sep 08 '21 20:09 jtuttle

Hi @JfcAtCyberArk!

Thank you for the submission!

I'm having trouble reproducing what you're seeing. I'm also seeing our Jenkins tests passing, and they're configured with a conjur provider in their manifests.

Also, when I try the change you suggested, I see the following error:

on main.tf line 9:
    9: provider "cyberark/conjur" {}
 
 cyberark/conjur is an invalid provider local name: must contain only letters, digits, and dashes, and may not use leading or trailing dashes

So... I'm wondering if I'm testing with a different version of Terraform, or just not configuring things the same way that you are.

One problem that I do see is that all of our example manifests in https://github.com/cyberark/terraform-provider-conjur repository don't include a required_providers field, which should look like this:

terraform {
  required_providers {
    conjur = {
      source  = "cyberark/conjur"
    }
  }
}

Some questions:

  • What version of Terraform are you using? (I'm using 1.0.6)

  • Which specific manifest are you using? Is it:

    • One of the manifests in the README.md?
    • The manifest in the `docs/index.md file?
    • A manifest from official documentation? If so, can you send me a URL?
  • Can you try using terraform init with the following example:

    # Add this to a 'main.tf' file
    terraform {
      required_providers {
        conjur = {
          source  = "cyberark/conjur"
        }
      }
    }
    
    provider "conjur" {}
    

Thanks, -Dane

diverdane avatar Sep 13 '21 19:09 diverdane

The issue here is a difference between what is currently said in the README.md and what should be done since v0.6.2 when the files were changed and the provider was moved to the Terraform registry. The README.md still shows how to do it using the plugin and local binaries.

OLeonardoRodrigues avatar Sep 13 '21 22:09 OLeonardoRodrigues

@OLeonardoRodrigues,

Thanks for the explanation, that helps!!! It looks like several things need to be updated:

I would think that the main README.md can just have examples using the Terraform registry, and we can move the examples that use local binaries to CONTRIBUTING.md.

Quick sanity check... Is this the best syntax for the manifests?:

terraform {
  required_providers {
    conjur = {
      source  = "cyberark/conjur"
    }
  }
}

provider "conjur" {}

diverdane avatar Sep 14 '21 13:09 diverdane

This is still an issue that needs to be resolved.

infamousjoeg avatar Dec 26 '21 17:12 infamousjoeg

@infamousjoeg Will create a Jira issue for this and work it into sprint planning.

jtuttle avatar Jan 03 '22 20:01 jtuttle