hashicorp / hcp-terraform-operator

Kubernetes Operator allows managing HCP Terraform resources via Kubernetes Custom Resources.
https://developer.hashicorp.com/terraform/cloud-docs
Mozilla Public License 2.0
125 stars 32 forks source link

Add documentation for v1 to v2 migration with regards to module name change #410

Closed nabadger closed 5 months ago

nabadger commented 5 months ago

Description

We are attempting to migrate to from the v1 to the v2 operator. We noticed that when having a new Module CR referencing an existing resource (created by the v1 Workspace), we run into the following error:

provider-error

In the existing (v1) state file the module is named module.operator, where as in v2 it defaults to module.this.

This is configurable as per: https://github.com/hashicorp/terraform-cloud-operator/pull/172 but took a bit of while to find.

It would be good to document this in the migration docs (assuming we did the right thing).

Potential YAML Configuration

In our case we had to set the module name to operator, so that it generates module.operator as previous.

apiVersion: app.terraform.io/v1alpha2
kind: Module
spec:
  name: operator
...

References

Community Note

arybolovlev commented 5 months ago

Hi @nabadger,

Thank you for bringing our attention here. There are a few things that are currently missing in the migration guide and I am working on updating it. The Module name is one of the things that will be added.

Let's keep this issue open until an updated guide is available.

Thanks!