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 26 commits
-
-
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.
-
Martin Atkins authored
This makes the new backend compatible with the new terraform.Context API, which has changed in main.
-
Chris Arcand authored
These changes allow cloud blocks to be overridden by backend blocks and vice versa; the logic follows the current backend behavior of a block overriding a preceding block in full, with no merges.
-
Chris Arcand authored
This restriction is temporary. Overrides should be allowed, but have the added complexity of needing to also override a 'backend' block, so this work is being deferred for now.
-
Chris Arcand authored
With the alternative block introduced in 7bf9b2c7b, this removes the ability to explicitly declare the 'cloud' backend. The literal backend interface is an implementation detail and no longer a user-level concept when using Terraform Cloud.
-
Chris Arcand authored
This is a replacement declaration for using Terraform Cloud as a remote backend, leaving the literal backend as an implementation detail and not a user-level concept.
-
Chris Arcand authored
-
Chris Arcand authored
The cloud package intends to implement a new integration for Terraform Cloud/Enterprise. The purpose of this integration is to better support TFC users; it will shed some overly generic UX and architecture, behavior changes that are otherwise backwards incompatible in the remote backend, and technical debt - all of which are vestiges from before Terraform Cloud existed. This initial commit is largely a porting of the existing 'remote' backend, which will serve as an underlying implementation detail and not be a typical user-level backend. This is because to re-implement the literal backend interface is orthogonal to the purpose of this integration, and can always be migrated away from later. As this backend is considered an implementation detail, it will not be registered as a declarable backend. Within these changes it is, for easy of initial development and a clean diff.
-
- 26 Oct, 2021 2 commits
-
-
Alisdair McDiarmid authored
command/init: Fail if -input=false but required
-
Laura Pacilio authored
replace an with a
-
- 25 Oct, 2021 6 commits
-
-
Krista LaFentres (she/her) authored
Clarify the way the trim() function works
-
Krista LaFentres authored
-
Alisdair McDiarmid authored
When running `terraform init` against a backend with multiple workspaces, none of which are the currently indicated local workspace, Terraform prompts the user to choose a workspace from the list. In automation, using the `-input=false` argument should disable asking for input, but previously would hang instead.
-
Alisdair McDiarmid authored
cli: Fix backend init failure with deleted cache
-
Alisdair McDiarmid authored
backend/remote: Fix version check when migrating
-
Alisdair McDiarmid authored
When an explicit backend is configured with a configuration which has not yet been initialized, running `terraform init` performs a state migration to fetch the remotely stored state in order to operate on it. Like the previous bug introduced by the recent provider diagnostics change, this code path was not correctly configured to enable init mode for the backend, which resulted in a fatal error during init when the cache dir is deleted. Setting the `Init` backend option allows this code path to continue without error when first initializing the backend for state migration. The new e2e test fails without this change.
-
- 23 Oct, 2021 1 commit
-
-
Martin Atkins authored
-
- 22 Oct, 2021 1 commit
-
-
Alisdair McDiarmid authored
cli: Fix init failure with deleted cache
-
- 21 Oct, 2021 3 commits
-
-
Alisdair McDiarmid authored
When migrating state to an existing Terraform Cloud workspace using the remote backend, we check the remote version is compatible with the local one by default. This commit fixes two bugs in this code: - If using the "name" strategy for the remote backend, the list of destination workspaces is empty. This resulted in no version checking of the remote workspace, and we fell back to the string equality check. - The user-specified CLI flag `-ignore-remote-version` was not being applied for the state migration version checking.
-
Alisdair McDiarmid authored
The init command needs to initialize a backend, in order to access state, in turn to derive provider requirements from state. The backend initialization step requires building provider factories, which previously would fail if a lockfile was present without a corresponding local provider cache. This commit ensures that in this situation only, errors with the provider factories are temporarily ignored. This allows us to continue to initialize the backend, fetch providers, and then report any errors as necessary.
-
Alisdair McDiarmid authored
We test that a deleted provider cache results in an error when running terraform plan, but previously did not test that running init (as instructed) would resolve the issue. This (failing) e2e test adds that step.
-
- 20 Oct, 2021 1 commit
-
-
James Bardin authored
backend/oss: Fixes the nil pointer panic error when missing access key or secret key
-