Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disambiguate consul backing store names to help during migration #10635

Closed
gc-ss opened this issue Jul 16, 2021 · 1 comment
Closed

Disambiguate consul backing store names to help during migration #10635

gc-ss opened this issue Jul 16, 2021 · 1 comment

Comments

@gc-ss
Copy link

gc-ss commented Jul 16, 2021

Feature Description

I currently have a consul cluster per environment and I use consul as the backing store for Terraform.
Often, after certain internal milestones/checkpoints, I change the consul cluster that Terraform is configured to use.
When this happens, the migration message output from Terraform confuses me.

For example, assume:

  • I have consul_cluster_a and consul_cluster_b.
  • the current OSS Terraform workspace uses consul_cluster_a as the backing store
  • after a while, I have to change the backing store from consul_cluster_a to consul_cluster_b
  • Then I see the following migration message:
Do you want to migrate all workspaces to "consul"?
  Both the existing "consul" backend and the newly configured "consul" backend
  support workspaces. When migrating between backends, Terraform will copy
  all workspaces (with the same names). THIS WILL OVERWRITE any conflicting
  states in the destination.

  Terraform initialization doesn't currently migrate only select workspaces.
  If you want to migrate a select number of workspaces, you must manually
  pull and push those states.

  If you answer "yes", Terraform will migrate all states. If you answer
  "no", Terraform will abort.

This is very confusing, to me, as I have no idea which consul_cluster_a or consul_cluster_b is being mentioned when it says "consul" in:

Do you want to migrate all workspaces to "consul"?
  Both the existing "consul" backend and the newly configured "consul" backend
  support workspaces. When migrating between backends, Terraform will copy

I would have preferred to see, something more explicit like:

Do you want to migrate all workspaces to "consul_cluster_b"?
  Both the existing "consul_cluster_a" backend and the newly configured "consul_cluster_b" backend
  support workspaces. When migrating between backends, Terraform will copy

My current definition block looks like this:

    backend "consul" {
      …
    }
  1. Is there something I can modify to get the behavior I want?
  2. Is this possible at all?

Please use the reaction feature (https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to add upvotes to pre-existing requests.

@gc-ss
Copy link
Author

gc-ss commented Jul 16, 2021

@gc-ss gc-ss closed this as completed Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant