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

Provider Config / Secret ? #49

Closed
milkpirate opened this issue Mar 30, 2024 · 10 comments
Closed

Provider Config / Secret ? #49

milkpirate opened this issue Mar 30, 2024 · 10 comments

Comments

@milkpirate
Copy link

Could you please add an example of what to put in the provider configs secret? Sadly this detail, most provider documentations are missing 😞

@milkpirate milkpirate changed the title Provider Config / Secret Provider Config / Secret ? Mar 30, 2024
@cdloh
Copy link
Owner

cdloh commented Mar 31, 2024

I'll gather this for you later this week :)

Are you looking to actively use this @milkpirate ?

I haven't updated this for a while but happy to give it a dust off if you want.

@milkpirate
Copy link
Author

milkpirate commented Apr 1, 2024

Yes 😄, I have quite a cloudflare setup and would like to put that in code. I already tired other providers (namely: https://github.com/crossplane-contrib/provider-cloudflare) but it seems to be totally outdated and under-featured.

@milkpirate
Copy link
Author

milkpirate commented Apr 1, 2024

Ok, realized there are example and found the one for the provider config's secret. This works like a charm ❤️ (with the global API key).

image

Though is it possible to use the API tokens with finer grained / less permissions?

image

Replaced the credentials JSON in the secret data with just:

    {
      "api_token": "<token>"
    }

and it "kinda" works, but though the token has edit permissions, the provider cannot observe the resources at CF:

...
status:
  conditions:
  - lastTransitionTime: "2024-04-01T21:56:02Z"
    message: 'observe failed: cannot run refresh: refresh failed: unable to find Access
      Identity Provider "daceeda4-e214-4ba6-8952-3f9c0ab68157": Authentication error
      (10000): '
    reason: ReconcileError
    status: "False"
...

even adding read permissions does not resolve the issue.

@cdloh
Copy link
Owner

cdloh commented Apr 2, 2024

What resource are you trying that with @milkpirate ?

@milkpirate
Copy link
Author

@cdloh
Copy link
Owner

cdloh commented Apr 2, 2024

Can you confirm what API permissions you've given the token? Preferably a screenshot of the API settings from the dashboard

I'll try to find some time tomorrow to test and fix if needed

@milkpirate
Copy link
Author

image
image

EDIT:
Realized that there is another more suiting permission. Its a but unclear how the WebUI "paths" map to the permissions in the selection, but thats not your problem. Anyway, with the following it works! 👍
image

@cdloh
Copy link
Owner

cdloh commented Apr 3, 2024

Great news @milkpirate!

I'm still going to work on getting a version of the provider out that supports V4 of the Terraform Provider. But its a bit more work to support the Plugin Framework.

@milkpirate
Copy link
Author

milkpirate commented Apr 3, 2024

Hmh... I see, the source here is generated right? From the the TF provider source. Hm... I guess the upbound generator is just having a look at the resources part, not additional stuff like the plugin framework. Sadly I was hardly using any of the code-to-code generation so far. Just once wrote some providers in Go... like manually. Are you related to Cloudflare or is it just for fun?

@cdloh
Copy link
Owner

cdloh commented Apr 3, 2024

It's fine support was recently added in upjet ( https://github.com/crossplane/upjet/releases/tag/v1.1.0 ) I've just gotta figure out how to configure it correctly

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

No branches or pull requests

2 participants