crossplane-contrib / provider-jet-equinix

Crossplane Provider for Equinix Metal, Fabric, and Network Edge
https://marketplace.upbound.io/providers/equinix/provider-jet-equinix/
Apache License 2.0
8 stars 4 forks source link

fix: restore auth keys in secrets #33

Closed displague closed 1 year ago

displague commented 1 year ago

Loading auth keys from secrets was incorrectly removed in v0.5 during the conversion to upjet. This was associated, incorrectly, with the deprecation of provider configuration via environment variables which suggested a main.tf.json was the approach to take for provider secret configuration.

Using a fields in a secret is still the common recommended approach:

There are some providers that support external configuration: https://github.com/crossplane/upjet/blob/main/docs/design-doc-provider-identity-based-auth.md

This change is necessary to get authentication working:

Status:
  At Provider:
  Conditions:
    Last Transition Time:  2023-10-26T11:35:05Z
    Message:               observe failed: cannot run refresh: refresh failed: the provider needs to be configured with the proper credentials before it
can be used.

One of pair "client_id" - "client_secret" or "token" must be set in the provider
configuration to interact with Equinix Fabric and Network Edge services, and
"auth_token" to interact with Equinix Metal. These can also be configured using
environment variables.

Please note that while the authentication arguments are individually optional to allow
interaction with the different services independently, trying to provision the resources
of a service without the required credentials will return an API error referring to
'Invalid authentication token' or 'error when acquiring token'.

More information on the provider configuration can be found here:
https://registry.terraform.io/providers/equinix/equinix/latest/docs: 
    Reason:  ReconcileError
    Status:  False
    Type:    Synced

Description of your changes

Fixes #

I have:

How has this code been tested