wundergraph / terraform-provider-cosmo

Manage your Federated GraphQL & Cosmo Architecture through Terraform.
https://registry.terraform.io/providers/wundergraph/cosmo/latest/docs
Apache License 2.0
3 stars 2 forks source link

Remove terraform.local from documentation and examples #6

Closed lekaf974 closed 1 month ago

lekaf974 commented 1 month ago

Following the tutorial examples/provider (release v0.0.2)

The terraform init command is not working properly

[provider]$ terraform init
Initializing the backend...
Initializing modules...
- cosmo-federated-graph in ../../modules/cosmo-federated-graph
- data_cosmo_federated_graph in ../data-sources/cosmo_federated_graph
- resource_cosmo_federated_graph in ../resources/cosmo_federated_graph
- resource_cosmo_namespace in ../resources/cosmo_namespace
- resource_cosmo_subgraph in ../resources/cosmo_subgraph
Initializing provider plugins...
- Reusing previous version of wundergraph/cosmo from the dependency lock file
- Finding terraform.local/wundergraph/cosmo versions matching "0.0.1"...
- Reusing previous version of hashicorp/random from the dependency lock file
- Installing wundergraph/cosmo v0.0.1...
- Installed wundergraph/cosmo v0.0.1 (self-signed, key ID 5F7E617DB4FE69A3)
- Installing hashicorp/random v3.6.3...
- Installed hashicorp/random v3.6.3 (signed by HashiCorp)
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 terraform.local/wundergraph/cosmo: could not connect to terraform.local: failed to request discovery document: Get "https://terraform.local/.well-known/terraform.json": dial tcp: lookup terraform.local on 192.168.3.1:53: no such host
lekaf974 commented 1 month ago

@AndreasZeissner created this issue and send a PR if it make sense

AndreasZeissner commented 1 month ago

Hi @lekaf974,

thanks for pointing that out. The examples are meant to be used with a local build of the terraform provider which you can do by running make clean build install and then e.g. make e2e.

It is a bit inconvenient at the moment, I agree. Please use the USE PROVIDER button here https://registry.terraform.io/providers/wundergraph/cosmo/latest to get the latest published version.

terraform {
  required_providers {
    cosmo = {
      source = "wundergraph/cosmo"
      version = "0.0.2"
    }
  }
}

provider "cosmo" {
  # Configuration options
}

You might open a PR for sure, I would just want these workflows to still exist as it's pretty handy during development. Apart from that I would have a look into making it more convenient in the future.

mevrin-ueat commented 1 month ago

the only think to do is to ensure that terraform.local is just removed from examples and documentation when it is released on terraform right ?

for example https://registry.terraform.io/providers/wundergraph/cosmo/latest/docs

image

AndreasZeissner commented 1 month ago

Hi,

@mevrin-ueat yes indeed. But at time of generating it's not yet clear which version the next one is. The tagging happens during release. The terraform.local is only used to reference the local plugin store.

have a look here:

I moved the provider into an extra file which will avoid that it's rendered and only the resource is present. I would say this does the job and keeps maintenance and confusion low.

lekaf974 commented 1 month ago

Closing PR created

AndreasZeissner commented 1 month ago

@lekaf974 @mevrin-ueat,

I recently released version 0.1.0:

Things are way cleaner now.