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. 31 Jan, 2019 4 commits
    • Martin Atkins's avatar
      vendor: Upgrade both HCL2 and cty · c8d34b55
      Martin Atkins authored
      The cty change here fixes a panic situation when cty.Path.Apply is given
      a null value, making it now correctly return an error.
      
      However, the HCL2 change includes an alternative to cty.Path.Apply that
      uses HCL-level rules rather than cty-level rules, so the result behaves
      like an HCL expression would. Most uses of cty.Path.Apply ought to use
      hcl.ApplyPath instead, to ensure that the behavior is consistent with what
      users expect in the main language.
      c8d34b55
    • Radek Simko's avatar
      Merge pull request #20165 from hashicorp/vendor-bump-deps · a9aee4ba
      Radek Simko authored
      vendor: github.com/hashicorp/terraform-config-inspect@latest
      a9aee4ba
    • Radek Simko's avatar
    • Martin Atkins's avatar
      Switch to Go 1.11.5 · 1a8ddc26
      Martin Atkins authored
      An earlier commit incorrectly updated some versions in go.mod without also
      updating the vendor tree, so this also rolls those back to where they used
      to be so that we can roll them forward carefully and make sure the tests
      actually pass. (If we just accept these new versions as specified the
      tests do not pass, so some work is required to fix those regressions.)
      1a8ddc26
  2. 30 Jan, 2019 10 commits
  3. 29 Jan, 2019 8 commits
  4. 28 Jan, 2019 5 commits
  5. 25 Jan, 2019 5 commits
    • Martin Atkins's avatar
      helper/schema: TypeMap of Resource is actually of TypeString · ae0be75a
      Martin Atkins authored
      Historically helper/schema did not support non-primitive map attributes
      because they cannot be represented unambiguously in flatmap. When we
      initially implemented CoreConfigSchema here we mapped that situation to
      a nested block of mode NestingMap, even though that'd never worked until
      now, assuming that it'd be harmless because providers wouldn't be using
      it.
      
      It turns out that some providers are, in fact, incorrectly populating
      a TypeMap schema with Elem: &schema.Resource, apparently under the false
      assumption that it would constrain the keys allowed in the map. In
      practice, helper/schema has just been ignoring this and treating such
      attributes as map of string. (#20076)
      
      In order to preserve the behavior of these existing incorrectly-specified
      attribute definitions, here we mimic the helper/schema behavior by
      presenting as an attribute of type map(string).
      
      These attributes have also been shown in some documentation as nested
      blocks (with no equals sign), so that'll need to be fixed in user
      configurations as they upgrade to Terraform 0.12. However, the existing
      upgrade tool rules will take care of that as a natural consequence of the
      name being indicated as an attribute in the schema, rather than as a block
      type.
      
      This fixes #20076.
      ae0be75a
    • Martin Atkins's avatar
      lang: New file-hashing functions · 954d38e8
      Martin Atkins authored
      In prior versions, we recommended using hash functions in conjunction with
      the file function as an idiom for detecting changes to upstream blobs
      without fetching and comparing the whole blob.
      
      That approach relied on us being able to return raw binary data from
      file(...). Since Terraform strings pass through intermediate
      representations that are not binary-safe (e.g. the JSON state), there was
      a risk of string corruption in prior versions which we have avoided for
      0.12 by requiring that file(...) be used only with UTF-8 text files.
      
      The specific case of returning a string and immediately passing it into
      another function was not actually subject to that corruption risk, since
      the HIL interpreter would just pass the string through verbatim, but this
      is still now forbidden as a result of the stricter handling of file(...).
      
      To avoid breaking these use-cases, here we introduce variants of the hash
      functions a with "file" prefix that take a filename for a disk file to
      hash rather than hashing the given string directly. The configuration
      upgrade tool also now includes a rule to detect the documented idiom and
      rewrite it into a single function call for one of these new functions.
      
      This does cause a bit of function sprawl, but that seems preferable to
      introducing more complex rules for when file(...) can and cannot read
      binary files, making the behavior of these various functions easier to
      understand in isolation.
      954d38e8
    • Martin Atkins's avatar
      lang/funcs: Factor out the various hash function implementations · ecaaa91d
      Martin Atkins authored
      These all follow the pattern of creating a hash and converting it to a
      string using some encoding function, so we can write this implementation
      only once and parameterize it with a hash factory function and an encoding
      function.
      
      This also includes a new test for the sha512 function, which was
      previously missing a test and, it turns out, actually computing sha256
      instead.
      ecaaa91d
    • Kristin Laemmert's avatar
      command/jsonplan: sort resources by address (#20113) · 6e057c52
      Kristin Laemmert authored
      * command/jsonplan: sort resources by address
      * command/show: extend test case to include resources with count
      * command/json*: document resource ordering as consistent but undefined
      6e057c52
    • Martin Atkins's avatar
      vendor: go get github.com/zclconf/go-cty@master · fb0c9714
      Martin Atkins authored
      This fixes some consistency problems with how number strings were parsed
      in the msgpack decoder vs other situations.
      
      This commit also includes an upgrade of HCL2 to use this new cty function,
      though there's no change in behavior here since the new function is
      functionally equivalent to what it replaced.
      fb0c9714
  6. 24 Jan, 2019 7 commits
  7. 23 Jan, 2019 1 commit
    • Martin Atkins's avatar
      tools/terraform-bundle: refuse to bundle versions <0.12.0 · c70954ae
      Martin Atkins authored
      Since terraform-bundle is just a different frontend to Terraform's module
      installer, it is subject to the same installation constraints as Terraform
      itself.
      
      Terraform 0.12 cannot install providers targeting Terraform 0.11 and
      earlier, and so therefore terraform-bundle built with Terraform 0.12
      cannot either. A build of terraform-bundle from the v0.11 line must be
      used instead.
      
      Without this change, the latest revisions of terraform-bundle would
      install plugins for Terraform 0.12 to bundle along with Terraform 0.10 or
      0.11, which will not work at runtime due to the plugin protocol mismatch.
      
      Until now, terraform-bundle was incorrectly labelled with its own version
      number even though in practice it has no version identity separate from
      Terraform itself. Part of this change, then, is to make the
      terraform-bundle version match the Terraform version it was built against,
      though any prior builds will of course continue to refer to themselves
      as 0.0.1.
      
      If asked to create a bundle for a version of Terraform v0.12 or greater,
      an error will be returned instructing the user to use a build from the
      v0.11 branch or one of the v0.11.x tags in order to bundle those versions.
      
      This also includes a small fix for a bug where the tool would not fail
      properly when the requested Terraform version is not available for
      installation, instead just producing a zip file with no "terraform"
      executable inside at all. Now it will fail, allowing automated build
      processes to detect it and not produce a broken archive for distribution.
      c70954ae