Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manifest example in provider's documentation is wrong. #94

Open
1 of 3 tasks
JfcAtCyberArk opened this issue Sep 8, 2021 · 6 comments
Open
1 of 3 tasks

Manifest example in provider's documentation is wrong. #94

JfcAtCyberArk opened this issue Sep 8, 2021 · 6 comments

Comments

@JfcAtCyberArk
Copy link

JfcAtCyberArk commented Sep 8, 2021

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

  • Always
  • Sometimes
  • Non-Reproducible
@jtuttle
Copy link
Member

jtuttle commented Sep 8, 2021

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

@diverdane
Copy link
Contributor

diverdane commented Sep 13, 2021

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 diverdane self-assigned this Sep 13, 2021
@OLeonardoRodrigues
Copy link

OLeonardoRodrigues commented Sep 13, 2021

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.

@diverdane
Copy link
Contributor

@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" {}

@infamousjoeg
Copy link
Member

This is still an issue that needs to be resolved.

@jtuttle
Copy link
Member

jtuttle commented Jan 3, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants