upjet icon indicating copy to clipboard operation
upjet copied to clipboard

Option to override provider name in terraform block in case of third party provider

Open rshekha1 opened this issue 2 years ago • 1 comments

What problem are you facing?

While trying to create a provider for the following terraform provider https://registry.terraform.io/providers/CheckPointSW/infinity-next/latest. The provider name for the provider defined on the terraform registry is infinity-next(provider source: CheckPointSW/infinity-next) but the reference used in the resources is inext. In native terraform one can specify the provider name in the terraform block as below

terraform {
  required_providers {
    inext = {
      source  = "CheckPointSW/infinity-next"
      version = "1.0.3"
    }
  }
}

But while trying to create a Crossplane provider the terraform is trying to download the inext provider from the registry based on the resource name as the terraform block has not been configured appropriately. Is there a way to configure the terraform block somehow based on the above use case?

Below is the output from the generated Crossplane provider

Initializing the backend...

Initializing provider plugins...
- Finding checkpointsw/infinity-next versions matching "1.0.3"...
- Finding latest version of hashicorp/inext...
- Installing checkpointsw/infinity-next v1.0.3...
- Installed checkpointsw/infinity-next v1.0.3 (signed by a HashiCorp partner, key ID 3FE04CFABC51EB9E)

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider
│ hashicorp/inext: provider registry registry.terraform.io does not have a
│ provider named registry.terraform.io/hashicorp/inext
│
│ All modules should specify their required_providers so that external
│ consumers will get the correct providers when using a module. To see which
│ modules are currently depending on hashicorp/inext, run the following
│ command:
│     terraform providers

How could Upjet help solve your problem?

Possibility for overriding provider name in the provider block with instead of using the name from the specified provider source.

rshekha1 avatar Aug 10 '23 22:08 rshekha1

Hi, we are running into this exact issue trying to convert our custom Terraform Provider at rropen/terraform-provider-csc-domain-manager into a Crossplane Provider here: rropen/provider-csc-domain-manager.

Were you able to solve this @rshekha1? Or is there still no way to override this property currently?

Den4200 avatar Aug 01 '25 21:08 Den4200