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.
- 29 Oct, 2021 40 commits
-
-
Barrett Clark authored
-
Barrett Clark authored
-
Chris Arcand authored
-
Omar Ismail authored
-
Omar Ismail authored
* Handle when there are multiple workspaces migrating to cloud, using both the cloud name strategy and cloud tags strategy. * Add e2e tests
-
Nick Fagerlund authored
Explicit version strings are actually also version constraints! And the special comparisons we were doing to allow a range of compatible versions can also be expressed as version constraints. Bonus: also simplify the way we handle version check errors, by composing the messages inline and only extracting the repetitive parts into a function.
-
Barrett Clark authored
-
Nick Fagerlund authored
-
Nick Fagerlund authored
The cloud backend (and remote before it) previously expected a TFC workspace's `terraform-version` attribute to be either the magic string `"latest"` or an explicit semver value. But a workspace might have a version constraint instead (like `~> 1.1.0`), in which case the version check would blow up. This commit checks whether `terraform-version` is a valid version constraint before erroring out, and if so, returns success if the local version meets the constraint. Because it's not practical to deeply introspect the slice of version space defined by a constraint, this check is slightly less robust than the version comparisons below it: - It can give a false OK on open-ended constraints like `>= 1.1.0`. Say you're running 1.3.0, it changed the state format, and the TFE instance admin has not yet added any 1.3.x Terraform versions; your workspace will now break. - It will give a false not-OK when using different minor versions within a range that we know to be compatible, e.g. remote constraint of `~> 0.15.0` and local version of 1.1.0. - This would be totally useless with the pre-0.14 versions of Terraform, where patch releases could change state format... but we're not going back in time to add this feature to them anyway. Still, in the most common likely case (`~> x.y.z`), it'll complain at you (with an error you can choose to override) if you're not using the same minor version, and that seems proportionate, useful, and expected.
-
Brandon Croft authored
-
Barrett Clark authored
Now that we have tags we no longer need prefix.
-
Barrett Clark authored
When a user runs `terraform refresh` we give them an error message that tells them to run `terraform apply -refresh-state`. We could just run that command for them, though. That is what this PR does.
-
Brandon Croft authored
-
Brandon Croft authored
-
Omar Ismail authored
Run variables allow the run API to accept input variables not found in the configuration slug (the file-based ones plus workspace vars)
-
Brandon Croft authored
1. ParseDeclaredValues: parses unparsed variables into terraform.InputValues 2. ProbeUndeclaredVariableValues: compares variable declarations with unparsed values to warn/error about undeclared variables
-
Omar Ismail authored
* determining source or destination to cloud * handling single to single state migrations to cloud, using a name strategy or a tags strategy * Add end-to-end tests for state migration.
-
Chris Arcand authored
These changes remove all of the preexisting version checking for individual features, wiping the slate clean with an overall minimum requirement of a future TFP-API-Version 2.5, which at the time of this writing is expected to be TFE v202112-1. It also actually provides that expected TFE version as an actionable error message, rather than generically saying that it isn't supported or using the somewhat opaque API version header.
-
Chris Arcand authored
The 'tfe' service was appended to with various versions to denote a new 'feature' implemented by a new 'service'. This quickly proved to not be scalable, as adding an entry to the discovery document from every feature is bad. The new mechanism added was checking the TFP-API-Version header on requests for a version, instead. So we'll remove the separation here between different tfe service 'versions' and the separate 'state' service and Just Use TFE, as well as the TFP-API-Version header for all feature versioning., as well as the TFP-API-Version header for all feature versioning.
-
Chris Arcand authored
This is an outdated mechanism that isn't used anymore.
-
Chris Arcand authored
This is a port of the changes made in #29683
-
Omar Ismail authored
-
Omar Ismail authored
-
Chris Arcand authored
-
Chris Arcand authored
The previous conservative guarantee that we would not make backwards incompatible changes to the state file format until at least Terraform 1.1 can now be extended. Terraform 0.14 through 1.1 will be able to interoperably use state files, so we can update the remote backend version compatibility check accordingly. This is a port of https://github.com/hashicorp/terraform/pull/29645
-
Chris Arcand authored
-
Chris Arcand authored
This changes the 'name' strategy to always align the local configured workspace name and the remote Terraform Cloud workspace, rather than the implicit use of the 'default' unnamed workspace being used instead. What this essentially means is that the Cloud integration does not fully support workspaces when configured for a single TFC workspace (as was the case with the 'remote' backend), but *does* use the backend.Workspaces() interface to allow for normal local behaviors like terraform.workspace to resolve to the correct name. It does this by always setting the local workspace name when the 'name' strategy is used, as a part of initialization. Part of the diff here is exporting all the previously unexported types for mapping workspaces. The command package (and init in particular) needs to be able to handle setting the local workspace in this particular scenario.
-
Omar Ismail authored
-
Omar Ismail authored
-
Chris Arcand authored
Implementing this test was quite a rabbithole, as in order to satisfy backendTestBackendStates() the workspaces returned from backend.Workspaces() must match exactly, and the shortcut taken to test pagination in 3cc58813 created an impossible circumstance that got plastered over with the fact that prefix filtering is done clientside, not by the API as it should be. Tagging does not rely on clientside filtering, and expects that the request made to the TFC API returns exactly those workspaces with the given tags. These changes include a better way to test pagination, wherein we actually create over a page worth of valid workspaces in the mock client and implement a simplified pagination behavior to match how the TFC API actually works.
-
Chris Arcand authored
The TFC API doesn't behave this way; a search term just signals the substring was found within the name.
-
Chris Arcand authored
"NoDefault" is now ambiguous with tags, and it does not imply using a prefix.
-
Chris Arcand authored
-
Chris Arcand authored
-
Chris Arcand authored
A mostly cosemetic change; The fields 'workspace' and 'prefix' don't really describe well what they are from a caller, so change these to use a workspaceMapping struct to convey they are for implementing workspace mapping strategies from CLI -> TFC
-
Omar Ismail authored
-
Omar Ismail authored
-
Chris Arcand authored
These changes include additions to fulfill the interface for the client mock, plus moving all that logic (which needn't be duplicated across both the remote and cloud packages) over to the cloud package under a dedicated mock client file.
-
Chris Arcand authored
-
Chris Arcand authored
I missed adding these in the original porting commit from the remote backend, because *.log is added to gitignore.
-