onelogin / terraform-provider-onelogin

GNU General Public License v3.0
27 stars 19 forks source link

Struggling to use the new provider 3.0.0 #104

Closed JRolfe-Gen closed 1 year ago

JRolfe-Gen commented 1 year ago

Using MacOS in Readme reference to provider does not work. Script installs provider here: ~/.terraform.d/plugins/terraform.example.com/examplecorp/onelogin/3.0.0/darwin_amd64/terraform-provider-onelogin

Which makes required provider configuration: terraform { required_providers { onelogin = { source = "terraform.example.com/examplecorp/onelogin" version = "= 3.0.0" } } }

I can now initialize terraform. However when I run a plan, I get this error:

❯ tf plan ╷ │ Error: Failed to load plugin schemas │ │ Error while loading schemas for plugin components: Failed to obtain provider schema: Could not load the schema for provider terraform.example.com/examplecorp/onelogin: failed to instantiate provider "terraform.example.com/examplecorp/onelogin" to │ obtain schema: Unrecognized remote plugin message: │ │ This usually means that the plugin is either invalid or simply │ needs to be recompiled to support the latest protocol...

Any thoughts?

JRolfe-Gen commented 1 year ago

Made it a little further. Following: https://discuss.hashicorp.com/t/could-not-load-the-schema-for-provider-for-both-aws-and-azurerm-after-init/48030/2 I received the error to set export OTF_VAR_onelogin_SWAGGER_URL="https://raw.githubusercontent.com/onelogin/terraform-provider-onelogin/master/swag-api.yml"

now the provider initializes, however Error: failed to configure the API request for GET https://api.us.onelogin.com/api/1/users: operation's security policy '{OAuth2}' is not defined

Jmfwolf commented 1 year ago

Hey thank you for the detailed reports! For the source, right now I recommend using source = jmfwolf/onelogin here is the terraform registry page The current onelogin/onelogin build has to be sideloaded and is not signed. The alternative listed above was forked, but is signed and released on the terraform registry.

The subdomain needs to be changed from api.us to your onelogin subdomain. I will edit the upcoming documentation to reflect these as well.

The Oauth2 portion is likely due a misconfiguration in the specification. There will be an updated specification and documentation release soon.

If the provider continues to have issues after the Oauth2 update. You may use Onelogin Developer Documentation while I adjust the specification and documentation on this repository to reflect the appropriate manual authentication headers.

Jmfwolf commented 1 year ago

If there is nothing more on it, please look at the new readme. The only signed version so far is still, terraform registry page