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.
- 31 Mar, 2021 1 commit
-
-
James Bardin authored
The shell autocomplete command will use the binary name as the first argument which does not show up under the list of subcommands.
-
- 26 Jan, 2021 1 commit
-
-
Jonathan Hall authored
-
- 13 Jan, 2021 1 commit
-
-
Martin Atkins authored
We need to call into terminal.Init in early startup to make sure that we either have a suitable Terminal or that we disable attempts to use virtual terminal escape sequences. This commit gets the terminal initialized but doesn't do much with it after that. Subsequent commits will make more use of this.
-
- 12 Jan, 2021 1 commit
-
-
Pam Selle authored
The revision field is only populated on dev builds so this means most releases of Terraform have an empty "terraform_revision" field in the JSON output. Since we recommend developers use go tooling to `go build` this tool when developing, the revision is not useful data and so it is removed.
-
- 30 Nov, 2020 1 commit
-
-
James Bardin authored
The default cli Warn calls always write to the error writer (stderr by default), however the output is intended to be viewed in the UI by the user, rather than in a separate stream. Terraform also generally does not consider warnings to be errors from the cli point of view, and does not need to output the warning text to stderr. By redirecting Warn calls to Output calls at the lowest level in the main package, we can eliminate the chance that Warn and Output messages are interleaved, while still allowing the internal `cli.Ui` implementations to format `Warn` and `Output` calls separately.
-
- 18 Nov, 2020 1 commit
-
-
Martin Atkins authored
Previously Terraform would react to an invalid top-level command the same way as for typing no command at all: just printing out the long top-level help directory. If someone's tried to type a command, it's more helpful to respond to that request by explaining directly that the command is invalid, rather than leaving the user to puzzle that out themselves by referring to the help text. As a bonus, this also allows us to use our "didyoumean" package to suggest possible alternatives if it seems like the user made a typo.
-
- 26 Oct, 2020 1 commit
-
-
James Bardin authored
Create a logger that will record any apparent crash output for later processing. If the cli command returns with a non-zero exit status, check for any recorded crashes and add those to the output.
-
- 23 Oct, 2020 1 commit
-
-
James Bardin authored
Now that hclog can independently set levels on related loggers, we can separate the log levels for different subsystems in terraform. This adds the new environment variables, `TF_LOG_CORE` and `TF_LOG_PROVIDER`, which each take the same set of log level arguments, and only applies to logs from that subsystem. This means that setting `TF_LOG_CORE=level` will not show logs from providers, and `TF_LOG_PROVIDER=level` will not show logs from core. The behavior of `TF_LOG` alone does not change. While it is not necessarily needed since the default is to disable logs, there is also a new level argument of `off`, which reflects the associated level in hclog.
-
- 21 Oct, 2020 3 commits
-
-
James Bardin authored
Use a separate log sink to always capture trace logs for the panicwrap handler to write out in a crash log. This requires creating a log file in the outer process and passing that path to the child process to log to.
-
James Bardin authored
The main process is now handling what output to print, so it doesn't do any good to try and run it through prefixedio, which is only adding extra coordination to echo the same data.
-
James Bardin authored
-
- 19 Oct, 2020 2 commits
-
-
James Bardin authored
Inject hclog as the default logger in the main binary.
-
James Bardin authored
remove a dead code file too
-
- 16 Oct, 2020 1 commit
-
-
Martin Atkins authored
For normal provider installation we want to associate each provider with a selected version number and find a suitable package for that version that conforms to the official hashes for that release. Those requirements are very onerous for a provider developer currently testing a not-yet-released build, though. To allow for that case this new CLI configuration feature allows overriding specific providers to refer to give local filesystem directories. Any provider overridden in this way is not subject to the usual restrictions about selected versions or checksum conformance, and activating an override won't cause any changes to the selections recorded in the lock file because it's intended to be a temporary setting for one developer only. This is, in a sense, a spiritual successor of an old capability we had to override specific plugins in the CLI configuration file. There were some vestiges of that left in the main package and CLI config packa...
-
- 13 Oct, 2020 1 commit
-
-
Pam Selle authored
-
- 04 Sep, 2020 1 commit
-
-
Martin Atkins authored
This new option is intended to address the previous inconsistencies where some older subcommands supported partially changing the target directory (where Terraform would use the new directory inconsistently) where newer commands did not support that override at all. Instead, now Terraform will accept a -chdir command at the start of the command line (before the subcommand) and will interpret it as a request to direct all actions that would normally be taken in the current working directory into the target directory instead. This is similar to options offered by some other similar tools, such as the -C option in "make". The new option is only accepted at the start of the command line (before the subcommand) as a way to reflect that it is a global command (not specific to a particular subcommand) and that it takes effect _before_ executing the subcommand. This also means it'll be forced to appear before any other command-specific arguments that take file paths, which hopeful...
-
- 03 Jun, 2020 1 commit
-
-
Alisdair McDiarmid authored
If we are unable to create a credentials source for some reason, we can rely on the disco object to nil-check it before calling any of its methods. However to do this we must ensure that we pass untyped nil. This commit rearranges the initialization to ensure that this happens. The user-facing bug that triggered this work is that running init when the HOME environment variable is unset would result in a panic on macOS.
-
- 27 May, 2020 1 commit
-
-
Paddy authored
This adds supports for "unmanaged" providers, or providers with process lifecycles not controlled by Terraform. These providers are assumed to be started before Terraform is launched, and are assumed to shut themselves down after Terraform has finished running. To do this, we must update the go-plugin dependency to v1.3.0, which added support for the "test mode" plugin serving that powers all this. As a side-effect of not needing to manage the process lifecycle anymore, Terraform also no longer needs to worry about the provider's binary, as it won't be used for anything anymore. Because of this, we can disable the init behavior that concerns itself with downloading that provider's binary, checking its version, and otherwise managing the binary. This is all managed on a per-provider basis, so managed providers that Terraform downloads, starts, and stops can be used in the same commands as unmanaged providers. The TF_REATTACH_PROVIDERS environment variable is...
-
- 23 Apr, 2020 1 commit
-
-
Martin Atkins authored
-
- 21 Apr, 2020 1 commit
-
-
Martin Atkins authored
If the CLI configuration contains a provider_installation block then we'll use the source configuration it describes instead of the implied one we'd build otherwise.
-
- 06 Apr, 2020 1 commit
-
-
Martin Atkins authored
This restores some of the local search directories we used to include when searching for provider plugins in Terraform 0.12 and earlier. The directory structures we are expecting in these are different than before, so existing directory contents will not be compatible without restructuring, but we need to retain support for these local directories so that users can continue to sideload third-party provider plugins until the explicit, first-class provider mirrors configuration (in CLI config) is implemented, at which point users will be able to override these to whatever directories they want. This also includes some new search directories that are specific to the operating system where Terraform is running, following the documented layout conventions of that platform. In particular, this follows the XDG Base Directory specification on Unix systems, which has been a somewhat-common request to better support "sideloading" of packages via standard Linux distribution package managers and other similar mechanisms. While it isn't strictly necessary to add that now, it seems ideal to do all of the changes to our search directory layout at once so that our documentation about this can cleanly distinguish "0.12 and earlier" vs. "0.13 and later", rather than having to document a complex sequence of smaller changes. Because this behavior is a result of the integration of package main with package command, this behavior is verified using an e2etest rather than a unit test. That test, TestInitProvidersVendored, is also fixed here to create a suitable directory structure for the platform where the test is being run. This fixes TestInitProvidersVendored.
-
- 24 Jan, 2020 1 commit
-
-
Martin Atkins authored
Following the same approach we use for other CLI-Config-able objects like the service discovery system, the main package is responsible for producing a suitable implementation of this interface which the command package can then use. When unit testing in the command package we can then substitute mocks as necessary, following the dependency inversion principle.
-
- 13 Jan, 2020 1 commit
-
-
Pam Selle authored
-
- 11 Oct, 2019 1 commit
-
-
Radek Simko authored
-
- 09 Sep, 2019 1 commit
-
-
Martin Atkins authored
This is more straightforward than using readline because it already works properly with panicwrap.
-
- 23 Aug, 2019 1 commit
-
-
Martin Atkins authored
This should not cause any change in behavior yet, but using this new implementation will allow the "terraform login" and "terraform logout" commands to store and forget credentials when they are implemented in subsequent commits.
-
- 01 Aug, 2019 1 commit
-
-
Martin Atkins authored
This is just a wholesale move of the CLI configuration types and functions from the main package into its own package, leaving behind some type aliases and wrappers for now to keep existing callers working. This commit alone doesn't really achieve anything, but in future commits we'll expand the functionality in this package.
-
- 05 Apr, 2019 1 commit
-
-
Matthew Sanabria authored
Fixes #15849
-
- 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
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.
-
Martin Atkins authored
If we get a diagnostic message that references a source range, and if the source code for the referenced file is available, we'll show a snippet of the source code with the source range highlighted. At the moment we have no cache of source code, so in practice this codepath can never be visited. Callers to format.Diagnostic will be gradually updated in subsequent commits.
-
- 03 Aug, 2018 2 commits
-
-
Sander van Harmelen authored
-
Sander van Harmelen authored
By adding this method you now only have to pass a `*disco.Disco` object around in order to do discovery and use any configured credentials for the discovered hosts. Of course you can also still pass around both a `*disco.Disco` and a `auth.CredentialsSource` object if there is a need or a reason for that!
-
- 14 Nov, 2017 1 commit
-
-
Martin Atkins authored
Now that we're expecting "credentials" blocks in the config (with auth tokens for private module registries, etc) we should not print out the config contents into the log, or else people will probably end up accidentally disclosing their credentials when sharing debug output with us, or will be reluctant to share debug output.
-
- 02 Nov, 2017 1 commit
-
-
Martin Atkins authored
The "terraform" provider was previously split out into its own repository, but that turned out to be a mistake due to how tightly it depends on aspects of Terraform Core. Here we prepare to bring it back into the core repository by reorganizing the directory layout to conform with what's expected there.
-
- 21 Oct, 2017 2 commits
-
-
Martin Atkins authored
Previously we handled all of the config sources directly within the main function. We're going to make CLI config loading more complex shortly, so having this encapsulated in its own function will avoid creating even more clutter inside the main function. Along the way here we also switch from using native Go "error" to using tfdiags.Diagnostics, so that we can potentially issue warnings here too in future, and so that we can return multiple errors.
-
Martin Atkins authored
We require that each "credentials" block has a valid hostname and that there be no more than one "credentials_helper" block. There are some more sophisticated validations we could do here, such as checking if the same host is declared more than once, but since this config handling will be rewritten to use HCL2 in the near future, and this sort of check is easier to do in the HCL2 API, we just check the basic stuff for now and plan to revisit later.
-
- 29 Sep, 2017 2 commits
-
-
Martin Atkins authored
Either the environment variable TF_PLUGIN_CACHE_DIR or a setting in the CLI config file (~/.terraformrc on Unix) allow opting in to the plugin caching behavior. This is opt-in because for new users we don't want to pollute their system with extra directories they don't know about. By opting in to caching, the user is assuming the responsibility to occasionally prune the cache over time as older plugins become stale and unused.
-
Martin Atkins authored
This, in principle, allows us to make use of configuration information when we populate the Meta structure, though we won't actually make use of that until a subsequent commit.
-
- 26 Sep, 2017 1 commit
-
-
Martin Atkins authored
The CLI package has automatic support for shell autocomplete (bash and zsh, at time of writing) for subcommands, so all we need to do here is just opt into it. Users can install this into their shells by running: terraform -install-autocomplete
-