crossplane / crossplane/upjet

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

Open
#253 2 comments 1 reaction 0 assignees View on GitHub
enhancement needs:triage
Dominant language
Go
Stars
481
Forks
131
Avg merge
2d 1h
Merged PRs (30d)
11

Description

### 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.