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.
  1. 17 Jun, 2022 1 commit
    • Martin Atkins's avatar
      Experiments supported only in alpha/dev builds · fda05795
      Martin Atkins authored
      We originally introduced the idea of language experiments as a way to get
      early feedback on not-yet-proven feature ideas, ideally as part of the
      initial exploration of the solution space rather than only after a
      solution has become relatively clear.
      
      Unfortunately, our tradeoff of making them available in normal releases
      behind an explicit opt-in in order to make it easier to participate in the
      feedback process had the unintended side-effect of making it feel okay
      to use experiments in production and endure the warnings they generate.
      This in turn has made us reluctant to make use of the experiments feature
      lest experiments become de-facto production features which we then feel
      compelled to preserve even though we aren't yet ready to graduate them
      to stable features.
      
      In an attempt to tweak that compromise, here we make the availability of
      experiments _at all_ a build-time flag which will not be set by default,
      and therefore experiments will not be available ...
      fda05795
  2. 11 Nov, 2021 2 commits
    • Katy Moe's avatar
      revert change to installModules diag handling · 6da61bf0
      Katy Moe authored
      Error diags from c.installModules() no longer cause getModules() to exit early.
      Whether installModules completed successfully, errored, or was cancelled, we
      try to update the manifest as best we can, preferring incomplete information
      to none.
      6da61bf0
    • kmoe's avatar
      command: make module installation interruptible · 40ec62c1
      kmoe authored
      Earlier work to make "terraform init" interruptible made the getproviders
      package context-aware in order to allow provider installation to be cancelled.
      
      Here we make a similar change for module installation, which is now also
      cancellable with SIGINT. This involves plumbing context through initwd and
      getmodules. Functions which can make network requests now include a context
      parameter whose cancellation cancels those requests.
      
      Since the module installation code is shared, "terraform get" is now
      also interruptible during module installation.
      40ec62c1
  3. 29 Oct, 2021 1 commit
  4. 10 Sep, 2021 1 commit
    • Martin Atkins's avatar
      workdir: Start of a new package for working directory state management · 65e0c448
      Martin Atkins authored
      Thus far our various interactions with the bits of state we keep
      associated with a working directory have all been implemented directly
      inside the "command" package -- often in the huge command.Meta type -- and
      not managed collectively via a single component.
      
      There's too many little codepaths reading and writing from the working
      directory and data directory to refactor it all in one step, but this is
      an attempt at a first step towards a future where everything that reads
      and writes from the current working directory would do so via an object
      that encapsulates the implementation details and offers a high-level API
      to read and write all of these session-persistent settings.
      
      The design here continues our gradual path towards using a dependency
      injection style where "package main" is solely responsible for directly
      interacting with the OS command line, the OS environment, the OS working
      directory, the stdio streams, and the CLI configura...
      65e0c448
  5. 17 May, 2021 5 commits
    • Martin Atkins's avatar
      Move terraform/ to internal/terraform/ · 36d0a504
      Martin Atkins authored
      This is part of a general effort to move all of Terraform's non-library
      package surface under internal in order to reinforce that these are for
      internal use within Terraform only.
      
      If you were previously importing packages under this prefix into an
      external codebase, you could pin to an earlier release tag as an interim
      solution until you've make a plan to achieve the same functionality some
      other way.
      36d0a504
    • Martin Atkins's avatar
      Move configs/ to internal/configs/ · 31349a9c
      Martin Atkins authored
      This is part of a general effort to move all of Terraform's non-library
      package surface under internal in order to reinforce that these are for
      internal use within Terraform only.
      
      If you were previously importing packages under this prefix into an
      external codebase, you could pin to an earlier release tag as an interim
      solution until you've make a plan to achieve the same functionality some
      other way.
      31349a9c
    • Martin Atkins's avatar
      Move command/ to internal/command/ · ffe056ba
      Martin Atkins authored
      This is part of a general effort to move all of Terraform's non-library
      package surface under internal in order to reinforce that these are for
      internal use within Terraform only.
      
      If you were previously importing packages under this prefix into an
      external codebase, you could pin to an earlier release tag as an interim
      solution until you've make a plan to achieve the same functionality some
      other way.
      ffe056ba
    • Martin Atkins's avatar
      Move tfdiags/ to internal/tfdiags/ · 05caff2c
      Martin Atkins authored
      This is part of a general effort to move all of Terraform's non-library
      package surface under internal in order to reinforce that these are for
      internal use within Terraform only.
      
      If you were previously importing packages under this prefix into an
      external codebase, you could pin to an earlier release tag as an interim
      solution until you've make a plan to achieve the same functionality some
      other way.
      05caff2c
    • Martin Atkins's avatar
      Move registry/ to internal/registry/ · 4c5b866d
      Martin Atkins authored
      This is part of a general effort to move all of Terraform's non-library
      package surface under internal in order to reinforce that these are for
      internal use within Terraform only.
      
      If you were previously importing packages under this prefix into an
      external codebase, you could pin to an earlier release tag as an interim
      solution until you've make a plan to achieve the same functionality some
      other way.
      4c5b866d
  6. 11 Feb, 2021 1 commit
    • Alisdair McDiarmid's avatar
      cli: Add initial command views abstraction · c5a6aa31
      Alisdair McDiarmid authored
      Terraform supports multiple output formats for several sub-commands.
      The default format is user-readable text, but many sub-commands support
      a `-json` flag to output a machine-readable format for the result. The
      output command also supports a `-raw` flag for a simpler, scripting-
      focused machine readable format.
      
      This commit adds a "views" abstraction, intended to help ensure
      consistency between the various output formats. This extracts the render
      specific code from the command package, and moves it into a views
      package. Each command is expected to create an interface for its view,
      and one or more implementations of that interface.
      
      By doing so, we separate the concerns of generating the sub-command
      result from rendering the result in the specified output format. This
      should make it easier to ensure that all output formats will be updated
      together when changes occur in the result-generating phase.
      
      There are some other consequences of this restructuring:
      
      - Views now directly access the terminal streams, rather than the
        now-redundant cli.Ui instance;
      - With the reorganization of commands, parsing CLI arguments is now the
        responsibility of a separate "arguments" package.
      
      For now, views are added only for the output sub-command, as an example.
      Because this command uses code which is shared with the apply and
      refresh commands, those are also partially updated.
      c5a6aa31
  7. 07 Oct, 2020 1 commit
    • Kristin Laemmert's avatar
      remove unused code (#26503) · d2e999ba
      Kristin Laemmert authored
      * remove unused code
      
      I've removed the provider-specific code under registry, and unused nil
      backend, and replaced a call to helper from backend/oss (the other
      callers of that func are provisioners scheduled to be deprecated).
      
      I also removed the Dockerfile, as our build process uses a different
      file.
      
      Finally I removed the examples directory, which had outdated examples
      and links. There are better, actively maintained examples available.
      
      * command: remove various unused bits
      
      * test wasn't running
      
      * backend: remove unused err
      d2e999ba
  8. 06 Dec, 2019 1 commit
  9. 02 Oct, 2019 1 commit
    • Martin Atkins's avatar
      vendor: switch to HCL 2.0 in the HCL repository · 39e609d5
      Martin Atkins authored
      Previously we were using the experimental HCL 2 repository, but now we'll
      shift over to the v2 import path within the main HCL repository as part of
      actually releasing HCL 2.0 as stable.
      
      This is a mechanical search/replace to the new import paths. It also
      switches to the v2.0.0 release of HCL, which includes some new code that
      Terraform didn't previously have but should not change any behavior that
      matters for Terraform's purposes.
      
      For the moment the experimental HCL2 repository is still an indirect
      dependency via terraform-config-inspect, so it remains in our go.sum and
      vendor directories for the moment. Because terraform-config-inspect uses
      a much smaller subset of the HCL2 functionality, this does still manage
      to prune the vendor directory a little. A subsequent release of
      terraform-config-inspect should allow us to completely remove that old
      repository in a future commit.
      39e609d5
  10. 12 Mar, 2019 1 commit
  11. 08 Mar, 2019 1 commit
  12. 14 Jan, 2019 2 commits
    • Martin Atkins's avatar
      command: "terraform init" can partially initialize for 0.12upgrade · 86c02d5c
      Martin Atkins authored
      There are a few constructs from 0.11 and prior that cause 0.12 parsing to
      fail altogether, which previously created a chicken/egg problem because
      we need to install the providers in order to run "terraform 0.12upgrade"
      and thus fix the problem.
      
      This changes "terraform init" to use the new "early configuration" loader
      for module and provider installation. This is built on the more permissive
      parser in the terraform-config-inspect package, and so it allows us to
      read out the top-level blocks from the configuration while accepting
      legacy HCL syntax.
      
      In the long run this will let us do version compatibility detection before
      attempting a "real" config load, giving us better error messages for any
      future syntax additions, but in the short term the key thing is that it
      allows us to install the dependencies even if the configuration isn't
      fully valid.
      
      Because backend init still requires full configuration, this introduces a
      new mode of terrafor...
      86c02d5c
    • Martin Atkins's avatar
  13. 23 Nov, 2018 1 commit
    • Sander van Harmelen's avatar
      commands: make sure the correct flagset is used · ef905456
      Sander van Harmelen authored
      A lot of commands used `c.Meta.flagSet()` to create the initial flagset for the command, while quite a few of them didn’t actually use or support the flags that are then added.
      
      So I updated a few commands to use `flag.NewFlagSet()` instead to only add the flags that are actually needed/supported.
      
      Additionally this prevents a few commands from using locking while they actually don’t need locking (as locking is enabled as a default in `c.Meta.flagSet()`.
      ef905456
  14. 01 Nov, 2018 1 commit
  15. 17 Oct, 2018 10 commits
    • Martin Atkins's avatar
      Revert some work that happened since v0.12-dev branched · 541952bb
      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.
      541952bb
    • Martin Atkins's avatar
      command: Don't allow -var and -var-file when applying saved plan · 8e51363f
      Martin Atkins authored
      This reinstates an old behavior that was lost in the reorganization of how
      we deal with the -var and -var-file options.
      
      This fix is verified by TestApply_planVars now passing.
      8e51363f
    • Martin Atkins's avatar
      command: go fmt · 73318a43
      Martin Atkins authored
      73318a43
    • Martin Atkins's avatar
      command: collect root module variable values for apply/plan/refresh · de3944b9
      Martin Atkins authored
      This connects a missing link left by earlier refactoring: the command
      package is responsible for gathering up variable values provided by the
      user and passing them through to the backend to use in operations.
      de3944b9
    • Martin Atkins's avatar
      command: Show snippet of invalid resource addresses in import · d63c2fdd
      Martin Atkins authored
      If we fail to parse the resource address given to "terraform import" then
      it's helpful to produce a "source code" snippet of what the user provided
      so they might see more precisely which part of the address was invalid.
      d63c2fdd
    • Martin Atkins's avatar
      move "configschema" from "config" to "configs" · 479c6b24
      Martin Atkins authored
      The "config" package is no longer used and will be removed as part
      of the 0.12 release cleanup. Since configschema is part of the
      "new world" of configuration modelling, it makes more sense for
      it to live as a subdirectory of the newer "configs" package.
      479c6b24
    • Martin Atkins's avatar
      terraform: ugly huge change to weave in new HCL2-oriented types · c937c06a
      Martin Atkins authored
      Due to how deeply the configuration types go into Terraform Core, there
      isn't a great way to switch out to HCL2 gradually. As a consequence, this
      huge commit gets us from the old state to a _compilable_ new state, but
      does not yet attempt to fix any tests and has a number of known missing
      parts and bugs. We will continue to iterate on this in forthcoming
      commits, heading back towards passing tests and making Terraform
      fully-functional again.
      
      The three main goals here are:
      - Use the configuration models from the "configs" package instead of the
        older models in the "config" package, which is now deprecated and
        preserved only to help us write our migration tool.
      - Do expression inspection and evaluation using the functionality of the
        new "lang" package, instead of the Interpolator type and related
        functionality in the main "terraform" package.
      - Represent addresses of various objects using types in the addrs package,
        rather than hand-constructed strings. This is not critical to support
        the above, but was a big help during the implementation of these other
        points since it made it much more explicit what kind of address is
        expected in each context.
      
      Since our new packages are built to accommodate some future planned
      features that are not yet implemented (e.g. the "for_each" argument on
      resources, "count"/"for_each" on modules), and since there's still a fair
      amount of functionality still using old-style APIs, there is a moderate
      amount of shimming here to connect new assumptions with old, hopefully in
      a way that makes it easier to find and eliminate these shims later.
      
      I apologize in advance to the person who inevitably just found this huge
      commit while spelunking through the commit history.
      c937c06a
    • Martin Atkins's avatar
      command: Various updates for the new backend package API · ebafa517
      Martin Atkins authored
      This is a rather-messy, complex change to get the "command" package
      building again against the new backend API that was updated for
      the new configuration loader.
      
      A lot of this is mechanical rewriting to the new API, but
      meta_config.go and meta_backend.go in particular saw some major
      changes to interface with the new loader APIs and to deal with
      the change in order of steps in the backend API.
      ebafa517
    • Martin Atkins's avatar
      backend: Update interface and implementations for new config loader · 5782357c
      Martin Atkins authored
      The new config loader requires some steps to happen in a different
      order, particularly in regard to knowing the schema in order to
      decode the configuration.
      
      Here we lean directly on the configschema package, rather than
      on helper/schema.Backend as before, because it's generally
      sufficient for our needs here and this prepares us for the
      helper/schema package later moving out into its own repository
      to seed a "plugin SDK".
      5782357c
    • Martin Atkins's avatar
      command: new Meta methods for accessing the new config loader · fd5b7b42
      Martin Atkins authored
      We need to share a single config loader across all callers because that
      allows us to maintain the source code cache we'll use for snippets in
      error messages.
      
      Nothing calls this yet. Callers will be gradually updated away from Module
      and Config in subsequent commits.
      fd5b7b42