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. 22 Jan, 2019 3 commits
    • Radek Simko's avatar
      Update CHANGELOG.md · f341624d
      Radek Simko authored
      f341624d
    • Radek Simko's avatar
      Merge pull request #20067 from hashicorp/b-cmd-fmt-unknown-set · 7e0be7d8
      Radek Simko authored
      command/format: Fix rendering of unknown elements in set/map/list
      7e0be7d8
    • Martin Atkins's avatar
      backend: Undeclared variables in -var-file is a warning, not an error · 10bf4c76
      Martin Atkins authored
      In Terraform 0.11 and earlier we just silently ignored undeclared
      variables in -var-file and the automatically-loaded .tfvars files. This
      was a bad user experience for anyone who made a typo in a variable name
      and got no feedback about it, so we made this an error for 0.12.
      
      However, several users are now relying on the silent-ignore behavior for
      automation scenarios where they pass the same .tfvars file to all
      configurations in their organization and expect Terraform to ignore any
      settings that are not relevant to a specific configuration. We never
      intentionally supported that, but we don't want to immediately break that
      workflow during 0.12 upgrade.
      
      As a compromise, then, we'll make this a warning for v0.12.0 that contains
      a deprecation notice suggesting to move to using environment variables
      for this "cross-configuration variables" use-case. We don't produce errors
      for undeclared variables in environment variables, even though that
      potentially causes the same UX annoyance as ignoring them in vars files,
      because environment variables are assumed to live in the user's session
      and this it would be very inconvenient to have to unset such variables
      when moving between directories. Their "ambientness" makes them a better
      fit for these automatically-assigned general variable values that may or
      may not be used by a particular configuration.
      
      This can revert to being an error in a future major release, after users
      have had the opportunity to migrate their automation solutions over to
      use environment variables.
      
      We don't seem to have any tests covering this specific situation right
      now. That isn't ideal, but this change is so straightforward that it would
      be relatively expensive to build new targeted test cases for it and so
      I instead just hand-tested that it is indeed now producing a warning where
      we were previously producing an error. Hopefully if there is any more
      substantial work done on this codepath in future that will be our prompt
      to add some unit tests for this.
      10bf4c76
  2. 21 Jan, 2019 4 commits
  3. 19 Jan, 2019 1 commit
    • Martin Atkins's avatar
      core: Retain prior state if update fails with no new state · 15cd6d83
      Martin Atkins authored
      In an ideal world, providers are supposed to respond to errors during
      apply by returning a partial new state alongside the error diagnostics.
      In practice though, our SDK leaves the new value set to nil for certain
      errors, which was causing Terraform to "forget" the object altogether by
      assuming that the provider intended to say "null".
      
      We now adjust that assumption to apply only in the delete case. In all
      other cases (including updates) we retain the prior state if the new
      state is given as nil. Although we could potentially fix this in the SDK
      itself, I expect this is a likely bug in other future SDKs for other
      languages too, so this new assumption is a safer one to make to be
      resilient to data loss when providers don't behave perfectly.
      
      Providers that return both nil new value and no errors are considered
      buggy, but unfortunately that applies to the mocks in many of our tests,
      so for pragmatic reasons we can't generate an error for that case as we do
      for other "should never happen" situations. Instead, we'll just retain the
      prior value in the state so the user can retry.
      15cd6d83
  4. 18 Jan, 2019 7 commits
  5. 17 Jan, 2019 12 commits
    • James Bardin's avatar
      don't overwrite values in plan · 2cc65112
      James Bardin authored
      Plan can change known values too, which we can't match in sets. We'll
      find another way to normalize these eithout losing plan values.
      2cc65112
    • James Bardin's avatar
      add tests for nested default values · 4439a7dc
      James Bardin authored
      Don't lose default values set within a nested block.
      4439a7dc
    • Martin Atkins's avatar
      command: Restore single-file support in "terraform fmt" · 176a5abf
      Martin Atkins authored
      This possibility was lost in the rewrite to use HCL2, but it's used by
      a number of external utilities and text editor integrations, so we'll
      restore it here.
      
      Using the stdin/stdout mode is generally preferable for text editor use
      since it allows formatting of the in-memory buffer rather than directly
      the file on disk, but for editors that don't have support for that sort of
      tooling it can be convenient to just launch a single command and directly
      modify the on-disk file.
      176a5abf
    • Martin Atkins's avatar
      command: "terraform fmt" must fail if file has invalid syntax · b0a43cab
      Martin Atkins authored
      Since the HCL formatter only works with tokens, it can in principle be
      called with any input and produce some output. However, when given invalid
      syntax it will tend to produce nonsensical results that may drastically
      change the input file and be hard for the user to undo.
      
      Since there's no strong reason to try to format an invalid or incomplete
      file, we'll instead try parsing first and fail if parsing does not
      complete successfully.
      
      Since we talk directly to the HCL API here this is only a _syntax_ check,
      and so it can be applied to files that are invalid in other ways as far
      as Terraform is concerned, such as using unsupported top-level block types,
      resource types that don't exist, etc.
      b0a43cab
    • Martin Atkins's avatar
      vendor: go get github.com/zclconf/go-cty@master · a10f9a18
      Martin Atkins authored
      There are no code changes in this update. This just catches up with the
      latest master commit in the upstream repo, which has only seen
      documentation updates since the prior commit.
      a10f9a18
    • Martin Atkins's avatar
      vendor: go get github.com/hashicorp/hcl2@master · 787c1760
      Martin Atkins authored
      This includes a missing feature for the splat syntax (null.* returns an
      empty tuple) and also fixes a bug in the source code formatter where it
      was inserting spaces between two consecutive interpolation sequences, like
      "${foo}${bar}".
      787c1760
    • Kim Ngo's avatar
      Update CHANGELOG.md · b88ef2b4
      Kim Ngo authored
      b88ef2b4
    • Martin Atkins's avatar
      Update CHANGELOG.md · 6ab15a80
      Martin Atkins authored
      6ab15a80
    • Martin Atkins's avatar
      lang/funcs: Type conversion functions · 2f8f7d6f
      Martin Atkins authored
      It's not normally necessary to make explicit type conversions in Terraform
      because the language implicitly converts as necessary, but explicit
      conversions are useful in a few specialized cases:
      
      - When defining output values for a reusable module, it may be desirable
        to force a "cleaner" output type than would naturally arise from a
        computation, such as forcing a string containing digits into a number.
      - Our 0.12upgrade mechanism will use some of these to replace use of the
        undocumented, hidden type conversion functions in HIL, and force
        particular type interpretations in some tricky cases.
      - We've found that type conversion functions can be useful as _temporary_
        workarounds for bugs in Terraform and in providers where implicit type
        conversion isn't working correctly or a type constraint isn't specified
        precisely enough for the automatic conversion behavior.
      
      These all follow the same convention of being named "to" followed by a
      short type name. Since we've had a long-standing convention of running all
      the words together in lowercase in function names, we stick to that here
      even though some of these names are quite strange, because these should
      be rarely-used functions anyway.
      2f8f7d6f
    • Kim Ngo's avatar
      Merge pull request #20030 from findkim/bump-plugin-install-version · ba6e243b
      Kim Ngo authored
      Bump provider installer protocol version to 5
      ba6e243b
    • Radek Simko's avatar
      Merge pull request #20004 from hashicorp/issue-template-labels · 5d4946e2
      Radek Simko authored
      Add labels to issue templates
      5d4946e2
    • Radek Simko's avatar
      Add labels to issues templates · b661a983
      Radek Simko authored
      b661a983
  6. 16 Jan, 2019 9 commits
  7. 15 Jan, 2019 4 commits