NOTES:
ENHANCEMENTS:
- tfexec: Added provider reattach support to all
terraform workspacesubcommands (#556) - tfexec: Add
-generate-config-outto the(Terraform).Plan()method (#563) - Add support for
providers mirrorsubcommand (#551)
DEPENDENCIES:
- build(deps): bump golang.org/x/crypto from 0.36.0 to 0.45.0 (#547)
- build(deps): bump github.com/hashicorp/go-version from 1.7.0 to 1.8.0 (#552)
- build(deps): bump github.com/hashicorp/hc-install from 0.9.2 to 0.9.3 (#566)
- build(deps): bump github.com/hashicorp/terraform-json from 0.27.1 to 0.27.2 (#542)
- build(deps): bump github.com/zclconf/go-cty from 1.16.4 to 1.17.0 (#535)
ENHANCEMENTS:
- Implement
QueryJSONand introduce new way for consuming Terraform's structured logging (#539)
INTERNAL:
- bump actions/setup-go from 5.5.0 to 6.0.0 (#536)
BUG FIXES:
- Avoid closing stdio pipes early on graceful (SIGINT-based) cancellation (#527)
- This enables correct handling of graceful cancellation for recent versions of Terraform (1.1+). Older versions should use
SetEnableLegacyPipeClosing(true)to avoid hanging on cancellation.
- This enables correct handling of graceful cancellation for recent versions of Terraform (1.1+). Older versions should use
INTERNAL:
- bump github.com/cloudflare/circl from 1.6.0 to 1.6.1 (#524)
- bump github.com/hashicorp/terraform-json from 0.24.0 to 0.26.0 (#520 & #529)
- bump github.com/zclconf/go-cty from 1.16.2 to 1.16.4 (#522 & #532)
- bump golang.org/x/net from 0.36.0 to 0.38.0 (#515)
ENHANCEMENTS:
- Context cancellation on Unix systems will now send Terraform process SIGINT instead of killing it (which is otherwise default
os/execbehaviour) (#512)- You can change the default
60sWaitDelayviaSetWaitDelay(time.Duration)
- You can change the default
- error type returned from individual commands now implements
Unwrapmaking it possible to pass it intoerrors.Asand access lower-level error such asexec.ExitError(#512)
NOTES:
ENHANCEMENTS:
- tfexec: Add support for
terraform init --jsonviaInitJSON(#478)
INTERNAL:
- go: Require Go 1.22 (previously 1.18) (#499)
ENHANCEMENTS:
- tfexec: Add
-allow-deferralto(Terraform).Apply()and(Terraform).Plan()methods (#447)
ENHANCEMENTS:
- Add
JSONNumberoption toShowto enablejson.Numberrepresentation of numerical values in returnedtfjson.Planandtfjson.Statevalues (#427)
ENHANCEMENTS:
- Add support for
terraform testcommand (#398) - Add support for
-refresh-onlyflag forPlanandApplymethods. (#402) - Add support for
-destroyflag forApply(#292)
BUG FIXES:
- Fix bug in which the
TF_WORKSPACEenv var was set to an empty string, instead of being unset as intended. (#388)
BUG FIXES:
- Fix bug in which errors returned from commands such as
(Terraform).Apply()were missing stderr output from Terraform. (#372)
BREAKING CHANGES:
- The following error types have been removed. These errors were based on regex parsing of Terraform CLI's human-readable output into custom error cases. (#352)
ErrConfigInvalidErrLockIdInvalidErrMissingVarErrNoConfigErrNoInitErrNoWorkspaceErrStateLockedErrStatePlanReadErrTFVersionMismatchErrWorkspaceExists
ENHANCEMENTS:
- tfexec: Add
(Terraform).ApplyJSON(),(Terraform).DestroyJSON(),(Terraform).PlanJSON()and(Terraform).RefreshJSON()methods (#354) - tfexec: Add
(Terraform).MetadataFunctions()method (#358)
Please note that terraform-exec now requires Go 1.18.
BUG FIXES:
- Fix bug in which
terraform initwas always called with the-force-copyflag (#268) - Always pass
-no-colorflag when callingterraform force-unlock(#270)
ENHANCEMENTS:
- tfexec: Add
(Terraform).SetLogCore()and(Terraform).SetLogProvider()methods (#324)
INTERNAL:
- Bump github.com/hashicorp/go-version from 1.5.0 to 1.6.0 (#323)
BUG FIXES:
- Fix bug in which
StatePushwould fail with "Exactly one argument expected" (#316)
FEATURES:
- Add
SetLog()method forTerraform(#291) - Add support for
state pullandstate push(#215) - Add support for running e2e tests against a local Terraform executable with
TFEXEC_E2ETEST_TERRAFORM_PATH(#305)
BUG FIXES:
- Avoid data race conditions (#299)
INTERNAL:
- Bump github.com/hashicorp/go-version from 1.4.0 to 1.5.0 (#306)
This patch version removes some unnecessary dependencies, and bumps Go module compatibility to 1.17.
This release removes the experimental tfinstall package. We recommend users of tfinstall switch to https://github.com/hashicorp/hc-install.
Please note also terraform-exec's Go version support policy, which, like Go's own release policy, commits to supporting the last two major releases. This means that currently terraform-exec requires Go 1.17 or later.
BREAKING CHANGES:
FEATURES:
- Add support for
workspace deletecommand (#212) - Add support for
workspace showcommand (#245) - Add support for
force-unlockcommand (#223) - Add support for
graphcommand (#257) - Add support for
taintcommand (#251) - Add support for
untaintcommand (#251) - Add
ErrStatePlanRead, returned when Terraform cannot read a given state or plan file (#273)
FEATURES:
- Add support for
providers lockcommand (#203) - Add support for
addcommand (#209) - Add support for
Plan/ApplyReplaceoption (#211)
ENHANCEMENTS:
- Introduce
tfexec.ErrStateLockedto represent locked state error (#221) - Account for upcoming init error message change (#228)
INTERNAL:
- deps: Bump terraform-json to
0.13.0to address panic & support v1 JSON format (#224)
FEATURES:
- Add
ProtocolVersiontoReattachConfigstruct, enabling provider protocol v6 support in reattach mode, provided that Terraform and the provider plugin are both using go-plugin v1.4.1 or later. This change is backwards-compatible, as zero values for this field are interpreted as protocol v5. (#182) - Introduce
tfexec.Get()for downloading modules (#176) - Introduce
tfexec.Upgrade013()(#178)
INTERNAL:
- Update
terraform-jsonto account for changes in state & plan JSON output in Terraform v1.0.1+ (#194) - Improve error message for incompatible Terraform version (#191)
SECURITY:
tfinstall: The HashiCorp PGP signing key has been rotated (HCSEC-2021-12). This key is used to verify downloaded versions of Terraform. We recommend all users of terraform-exec upgrade to v0.13.3 for this security fix. (#166)
N.B. Versions of terraform-exec prior to v0.13.3 will continue to verify older versions of Terraform (up to and including v0.15.0) for a limited period. Installation of Terraform using older versions of terraform-exec will stop working soon, and we recommend upgrading as soon as possible to avoid any interruption.
BUG FIXES:
- Update
terraform-jsonto support 0.15 changes in plan & config JSON output (#153) - Update
go-getterto prevent race conditions where consumers would requirego-cleanhttp>=0.5.2(which tfexec itself didn't depend on until now) (#154)
BUG FIXES:
- Bump version of terraform-json library to handle latest Terraform 0.15 output format (#143)
NOTES:
- This release no longer supports Go 1.12 (1.13+ is required)
Please note that this is the first release of terraform-exec compatible with Terraform 0.15. Running Terraform 0.15 commands with previous versions of terraform-exec may produce unexpected results.
FEATURES:
BREAKING CHANGES:
- Move Git ref installation to subpackage so that consumers can limit dependencies (#98)
FEATURES:
- Improve error handling for formatting command on unsupported version (
<0.7.7) (#88) - Introduce
Formatmethod withio.Reader/io.Writerinterfaces (#96) - Introduce
Validatemethod withtfjsondefined diagnostic types. Those types reflect exactly the types used interraform validate -jsonoutput (#68) - Introduce
StateMvmethod (#112) - Introduce
Upgrade012method (#105)
BUG FIXES:
- Fix issue in tfinstall.GitRef where it assumed a
vendordirectory was present (#89) - Use
json.Numberinstead offloat64when parsing state (#113) - Support long variable names in
ErrMissingVar(#110)
FEATURES:
- Added Terraform fmt support with the ability to format and write files/folders, check if files/folders need formatting, and format strings directly (#82)
- Added support for refs in the tfinstall CLI (#80)
N.B. tfinstall binaries for all supported platforms are now available via GitHub Releases.
FEATURES:
- Added the ability to customize the
User-Agentheader for sometfinstallfinders (#76) - Added well known error for a mismatch for
required_version(#66) - Added new
ShowPlanFileRawfunction to obtain the human-friendly output of a plan (#83)
BREAKING CHANGES:
context.Contextadded totfinstall.Findto allow for cancellation, timeouts, etc (#51)- You can no longer use
TF_WORKSPACEfor workspace management, you must useTerraform.WorkspaceSelect(#75)
FEATURES:
- Add
ErrWorkspaceExistsfor when workspaces with the same name already exist when callingTerraform.WorkspaceNew(#67) - Added
tfinstall.GitRefto support installation of Terraform from a git ref instead of by released version (#51) - Created the tfinstall CLI utility (this is mostly for use in things like CI automation) (#29)
- Added
ReattachOptionfor plugin reattach functionality (#78)
BREAKING CHANGES:
- Add
-detailed-exit-codetoTerraform.Plancalls,Terraform.Plannow also returns a bool indicating if any diff is present (#55)
FEATURES:
- Added
Terraform.SetAppendUserAgentfor User-Agent management from consuming applications (#46) - Added
Terraform.WorkspaceList,Terraform.WorkspaceNew, andTerraform.WorkspaceSelectalong with theErrNoWorkspaceerror to indicate a workspace does not exist (#56) - Added support for using multiple
VarFileoptions (#61)
BUG FIXES:
- Fix bug with checking for empty path before executing version command (#62)
FEATURES:
- Added
Terraform.Refreshmethod (#53) - Added
Terraform.ShowStateFileandTerraform.ShowPlanFile(#54) - Added support for
DIRpositional arg in init, destroy, and plan (#52) - Relaxed logger interface (#57)
- Added error for missing required variable (#57)
BUG FIXES:
- Fixed logging issue for error cmd (#57)
FEATURES:
- Added
Terraform.SetStdoutandTerraform.SetStderrto let consumers log CLI output (#49)
BUG FIXES:
- Fixed miscategorization of
ErrNoIniton Terraform 0.13 (#48)
FEATURES:
- Version compatibility testing for
terraform show(#41)
BUG FIXES:
- Tolerate reversed
terraform versionoutput order (#47)
FEATURES:
- Added
Terraform.SetLogPathmethod to setTF_LOG_PATHenvironment variable, and prevented manual setting of programmatically supported environment variables (#32) - Added
Terraform.Versionmethod to get executable version information (#7)
BUG FIXES:
- Fixed
-varhandling issue (#34)
BREAKING CHANGES:
- Stop exporting
exec.Cmdversions of methods (#25) - Require
addressandidarguments inImport()(#24) - Rename
StateShow()toShow()(#30)
BUG FIXES:
- Fix bug in
Import()config argument (#28)
BUG FIXES:
- Version number is now correctly reported by the tfinstall package. Please note that
tfinstall.Versionwas incorrect between versions 0.1.1 and 0.2.1 inclusive.
BUG FIXES:
- Minor code changes to allow for compilation in Go 1.12 (#21)
FEATURES:
- add
Import()function (#20)
BUG FIXES:
- Downgrade
github.com/hashicorp/go-getterdependency, which added a requirement for Go 1.13.
Initial release.
This Go module contains two packages, github.com/hashicorp/terraform-exec/tfexec, and github.com/hashicorp/terraform-exec/tfinstall, which share the same version.