Skip to content

🚀 Import/link to current/existing workspace #551

Open
@diepes

Description

@diepes

Description

We would like to deploy a workspace CRD that uses an existing workspace and start managing it.

Looking at
(https://developer.hashicorp.com/terraform/cloud-docs/integrations/kubernetes/api-reference#workspacespec)

The suggestion is to add a optional "workspace-tfc-id"
When set the hcp operator should use the existing workspace thus preserving the state and allowing migration to the operator for the workspace management.

Potential YAML Configuration

Could be annotation or a value under spec.
e.g. of annotation for existing workspace: ID: "ws-abcZwwwww"

workspace.yaml

# This manifest creates a Workspace in Terraform Cloud.
apiVersion: app.terraform.io/v1alpha2
kind: Workspace
metadata:
  name: "git-repo-testing"
  namespace: tfworkspace-poc
  annotations:
    workspace.app.terraform.io/run-new: "true"
    workspace.app.terraform.io/run-type: "plan"
    workspace.app.terraform.io/workspace-tfc-id: "ws-abcZwwwww"
spec:
     ...

References

Community Note

  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions