This project is mirrored from https://:*****@github.com/hashicorp/terraform.git.
Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
- 26 Jan, 2021 1 commit
-
-
Jonathan Hall authored
-
- 19 Jan, 2021 1 commit
-
-
Alisdair McDiarmid authored
Previously the state migration process was using the fallback strict error check when migrating to or from a Terraform Cloud workspace. This resulted in an error when running init if the local and remote Terraform versions did not exactly match. This was excessively strict. When migrating from a remote Terraform Cloud workspace to local state, there is no need for a version check at all, as we cannot break the Terraform Cloud workspace. When migrating to Terraform Cloud, we should use the more forgiving check, rather than the strict equality. This commit fixes both of these cases accordingly, and allows migrating state to and from Terraform Cloud remote workspaces without errors.
-
- 11 Aug, 2020 2 commits
-
-
Alisdair McDiarmid authored
The workspace name can be overridden by setting a TF_WORKSPACE environment variable. If this is done, we should still validate the resulting workspace name; otherwise, we could end up with an invalid and unselectable workspace. This change updates the Meta.Workspace function to return an error, and handles that error wherever necessary.
-
Kristin Laemmert authored
Most of the state package has been deprecated by the states package. This PR replaces all the references to the old state package that can be done simply - the low-hanging fruit. * states: move state.Locker to statemgr The state.Locker interface was a wrapper around a statemgr.Full, so moving this was relatively straightforward. * command: remove unnecessary use of state package for writing local terraform state files * move state.LocalState into terraform package state.LocalState is responsible for managing terraform.States, so it made sense (to me) to move it into the terraform package. * slight change of heart: move state.LocalState into clistate instead of terraform
-
- 24 May, 2019 1 commit
-
-
James Bardin authored
The backend gets to "prepare" the configuration before Configure is called, in order to validate the values and insert defaults. We don't want to store this value in the "config state", because it will often not match the raw config after it is prepared, forcing unecessary backend migrations during init. Since PrepareConfig is always called before Configure, we can store the config value directly, and assume that it will be prepared in the same manner each time.
-
- 23 May, 2019 1 commit
-
-
James Bardin authored
-
- 08 Mar, 2019 1 commit
-
-
Sander van Harmelen authored
-
- 19 Nov, 2018 2 commits
-
-
Martin Atkins authored
This just finishes off the logging added in earlier commits to get all the way through to the actual migration call.
-
Martin Atkins authored
This test was initially failing because its fixture had a state which our new state models consider to be "empty", and thus it was not migrated. After fixing that (by adding an output to the fixture), this revealed a bug that the lineage was not being persisted through the migration. This is fixed by using the statemgr.Migrate method instead of writing via the normal Writer interface, which allows two cooperating state managers to properly transfer the lineage and serial along with the state snapshot.
-
- 12 Nov, 2018 2 commits
-
-
Martin Atkins authored
This test was using old-style state files as its input, differing only by lineage. Since lineages are now managed within the state manager itself, the test can't use that to distinguish the two files and so we put a different output in each one instead. This also introduces some TRACE logging to the migration codepaths. There's some hard-to-follow control flow here and so this extra logging helps to understand the reason for a particular outcome, and since this codepath is visited only in "terraform init" anyway it doesn't hurt to be a bit more verbose here.
-
Sander van Harmelen authored
If the backend does not support workspaces, we don't have to try to select a workspace and we should not return an error.
-
- 06 Nov, 2018 1 commit
-
-
Sander van Harmelen authored
This is a refactored version of the `remote` backend that was initially added to Terraform v0.11.8 which should now be compatible with v0.12.0.
-
- 17 Oct, 2018 2 commits
-
-
Martin Atkins authored
This work was done against APIs that were already changed in the branch before work began, and so it doesn't apply to the v0.12 development work. To allow v0.12 to merge down to master, we'll revert this work out for now and then re-introduce equivalent functionality in later commits that works against the new APIs.
-
Martin Atkins authored
Due to how often the state and plan types are referenced throughout Terraform, there isn't a great way to switch them out gradually. As a consequence, this huge commit gets us from the old world to a _compilable_ new world, but still has a large number of known test failures due to key functionality being stubbed out. The stubs here are for anything that interacts with providers, since we now need to do the follow-up work to similarly replace the old terraform.ResourceProvider interface with its replacement in the new "providers" package. That work, along with work to fix the remaining failing tests, will follow in subsequent commits. The aim here was to replace all references to terraform.State and its downstream types with states.State, terraform.Plan with plans.Plan, state.State with statemgr.State, and switch to the new implementations of the state and plan file formats. However, due to the number of times those types are used, this also ended up affecting numerous other parts of core such as terraform.Hook, the backend.Backend interface, and most of the CLI commands. Just as with 5861dbf3 before, I apologize in advance to the person who inevitably just found this huge commit while spelunking through the commit history.
-
- 29 Aug, 2018 1 commit
-
-
Sander van Harmelen authored
Certain backends (currently only the `remote` backend) do not support using both the default and named workspaces at the same time. To make the migration easier for users that currently use both types of workspaces, this commit adds logic to ask the user for a new workspace name during the migration process.
-
- 03 Aug, 2018 1 commit
-
-
Sander van Harmelen authored
-
- 23 Feb, 2018 6 commits
-
-
James Bardin authored
Use the new StateLocker field to provide a wrapper for locking the state during terraform.Context creation in the commands that directly manipulate the state.
-
James Bardin authored
Simplify the use of clistate.Lock by creating a clistate.Locker instance, which stores the context of locking a state, to allow unlock to be called without knowledge of how the state was locked. This alows the backend code to bring the needed UI methods to the point where the state is locked, and still unlock the state from an outer scope. Provide a NoopLocker as well, so that callers can always call Unlock without verifying the status of the lock. Add the StateLocker field to the backend.Operation, so that the state lock can be carried between the different function scopes of the backend code. This will allow the backend context to lock the state before it's read, while allowing the different operations to unlock the state when they complete.
-
James Bardin authored
This reverts commit e88bd74b.
-
James Bardin authored
This reverts commit 400f6ca4.
-
James Bardin authored
Use the new StateLocker field to provide a wrapper for locking the state during terraform.Context creation in the commands that directly manipulate the state.
-
James Bardin authored
Simplify the use of clistate.Lock by creating a clistate.Locker instance, which stores the context of locking a state, to allow unlock to be called without knowledge of how the state was locked. This alows the backend code to bring the needed UI methods to the point where the state is locked, and still unlock the state from an outer scope.
-
- 04 Jan, 2018 1 commit
-
-
James Bardin authored
The existing prompts were worded as if backend configurations were named, but they can only really be referenced by their type. Change the wording to reference them as type "X backend". When migrating state, refer to the backends as the "previously configured" and "newly configured", since they will often have the same type.
-
- 18 Dec, 2017 1 commit
-
-
James Bardin authored
Only check for input twice in the meta.confirm method. This prevents an errant newline from aborting the run while allowing Terraform to exit if there is no input available. We don't just check for a tty, since we still rely on being able to pipe input in for testing. Remove the redundant confirmation loops in the migration code, and only use the confirm method.
-
- 09 Jun, 2017 2 commits
-
-
Martin Atkins authored
We're shifting terminology from "environment" to "workspace". This takes care of some of the main internal API surface that was using the old terminology, though is not intended to be entirely comprehensive and is mainly just to minimize the amount of confusion for maintainers as we continue moving towards eliminating the old terminology.
-
Martin Atkins authored
Feedback after 0.9 was that the term "environment" was confusing due to it colliding with several other concepts, such as OS environment variables, a non-aligned Terraform Enterprise concept, and differing ideas of "environment" within various organizations. This new term "workspace" is intended to ease some of that confusion. This term is not used anywhere else in Terraform today, and we expect it to not be used in a manner that would be confusing within user organizations. This begins a deprecation cycle for the "terraform env" family of commands, instead moving to an equivalent set of "terraform workspace" commands. There are some remaining references to the old "environment" concept in the code, which will be cleaned up in a separate change. This change is instead focused on text visible in the UI and wording within code comments for the benefit of human maintainers of the code.
-
- 24 May, 2017 1 commit
-
-
Mat Schaffer authored
-
- 11 Apr, 2017 1 commit
-
-
David Joos authored
"destionation" -> "destination"
-
- 04 Apr, 2017 1 commit
-
-
James Bardin authored
A couple commits got rebased together here, and it's easier to enumerate them in a single commit. Skip copying of states during migration if they are the same state. This can happen when trying to reconfigure a backend's options, or if the state was manually transferred. This can fail unexpectedly with locking enabled. Honor the `-input` flag for all confirmations (the new test hit some more). Also unify where we reference the Meta.forceInitCopy and transfer the value to the existing backendMigrateOpts.force field.
-
- 01 Apr, 2017 2 commits
-
-
James Bardin authored
Add fields required to create an appropriate context for all calls to clistate.Lock. Add missing checks for Meta.stateLock, where we would attempt to lock, even if locking should be skipped.
-
James Bardin authored
- Have the ui Lock helper use state.LockWithContext. - Rename the message package to clistate, since that's how it's imported everywhere. - Use a more idiomatic placement of the Context in the LockWithContext args.
-
- 22 Mar, 2017 1 commit
-
-
James Bardin authored
The `-force-copy` option will suppress confirmation for copying state data. Modify some tests to use the option, making sure to leave coverage of the Input code path.
-
- 20 Mar, 2017 1 commit
-
-
Mitchell Hashimoto authored
Fixes #12871 We were forgetting to remove the legacy remote state from the actual state value when migrating. This only causes an issue when saving a plan since the plan contains the state itself and causes an error where both a backend + legacy state exist. If saved plans aren't used this causes no noticable issue. Due to buggy upgrades already existing in the wild, I also added code to clear the remote section if it exists in a standard unchanged backend
-
- 16 Mar, 2017 1 commit
-
-
James Bardin authored
When migrating from a multi-state backend to a single-state backend, we have to ensure that our locally configured environment is changed back to "default", or we won't be able to access the new backend.
-
- 01 Mar, 2017 5 commits
-
-
Mitchell Hashimoto authored
-
Mitchell Hashimoto authored
-
Mitchell Hashimoto authored
-
Mitchell Hashimoto authored
-
Mitchell Hashimoto authored
-
- 15 Feb, 2017 1 commit
-
-
James Bardin authored
-