NOTES:
- all: This Go module has been updated to Go 1.22 per the Go support policy. It is recommended to review the Go 1.22 release notes before upgrading. Any consumers building on earlier Go versions may experience errors. (#1373)
- helper/schema: While this Go module will not receive support for ephemeral resource types, the provider server is updated to handle the new operations, which will be required to prevent errors when updating
terraform-plugin-framework
orterraform-plugin-mux
in the future. (#1390)
NOTES:
- all: The
v2.33.0
release updated this Go module to Go 1.21 per the Go support policy. It is recommended to review the Go 1.21 release notes before upgrading. Any consumers building on earlier Go versions may experience errors (#1318) - This release contains support for deferred actions, which is an experimental feature only available in prerelease builds of Terraform 1.9 and later. This functionality is subject to change and is not protected by version compatibility guarantees. (#1335)
FEATURES:
- helper/schema: Added
(Provider).ConfigureProvider
function for configuring providers that support additional features, such as deferred actions. (#1335) - helper/schema: Added
(Resource).ResourceBehavior
to allow additional control over deferred action behavior during plan modification. (#1335)
NOTES:
- helper/schema: While this Go module will not receive support for provider defined functions, the provider server is updated to handle the new operation, which will be required to prevent errors when updating terraform-plugin-framework or terraform-plugin-mux in the future (#1316)
NOTES:
- helper/schema: While this Go module will not receive support for moving resource state across resource types, the provider server is updated to handle the new operation, which will be required to prevent errors when updating terraform-plugin-framework or terraform-plugin-mux in the future. (#1307)
NOTES:
- helper/schema: While this Go module will not receive support for provider-defined functions, the provider server is updated to handle the new operations, which will be required to prevent errors when updating terraform-plugin-framework or terraform-plugin-mux in the future. (#1288)
NOTES:
- meta: The
SDKVersion
variable,SDKPrerelease
variable, andSDKVersionString()
function have been deprecated. Use the Go standard libraryruntime/debug
package build information instead. (#1257)
BUG FIXES:
- meta: Fixed version in
SDKVersion
variable andSDKVersionString()
function (#1257) - helper/schema: Ensured
(ResourceData).GetRawConfig()
data is populated forProvider.ConfigureFunc
andProvider.ConfigureContextFunc
(#1270) - helper/schema: Ensured
(ResourceData).GetOkExists()
second result istrue
when configuration contains zero-value data inProvider.ConfigureFunc
andProvider.ConfigureContextFunc
(#1270)
NOTES:
- all: This Go module has been updated to Go 1.20 per the Go support policy. It is recommended to review the Go 1.20 release notes before upgrading. Any consumers building on earlier Go versions may experience errors. (#1245)
FEATURES:
- helper/schema: Upgrade to protocol version 5.4, which can significantly reduce memory usage with Terraform 1.6 and later when a configuration includes multiple instances of the same provider (#1234)
ENHANCEMENTS:
- helper/validation: Added
AllDiag
andAnyDiag
, which areSchemaValidateDiagFunc
variants ofAll
andAny
(#1155) - helper/validation: Added quoting in
StringInSlice
error diagnostic output to prevent confusion with values that contain spaces (#464)
NOTES:
- helper/schema: The
Resource
typeEnableApplyLegacyTypeSystemErrors
andEnablePlanLegacyTypeSystemErrors
fields can be enabled to more easily discover resource data consistency errors which Terraform would normally demote to warning logs. Before enabling the flag in a production release for a resource, the resource should be exhaustively acceptance tested as there may be unrecoverable error situations for practitioners. It is recommended to first enable and test in environments where it is easy to clean up resources, potentially outside of Terraform. (#1227)
ENHANCEMENTS:
- helper/schema: Added
Resource
typeEnableLegacyTypeSystemApplyErrors
field, which will prevent Terraform from demoting data consistency errors to warning logs duringApplyResourceChange
(Create
,Update
, andDelete
) operations with the resource (#1227) - helper/schema: Added
Resource
typeEnableLegacyTypeSystemPlanErrors
field, which can be used to prevent Terraform from demoting data consistency errors to warning logs duringPlanResourceChange
operations with the resource (#1227)
NOTES:
- helper/schema: Consumers directly referencing the
Resource
typeSchema
field should switch to theSchemaMap
method to ensure newSchemaFunc
field data is properly retrieved (#1217)
ENHANCEMENTS:
- all: Improved SDK logging performance when messages would be skipped due to configured logging level (#1202)
- helper/schema: Added
Resource
typeSchemaFunc
field andSchemaMap
method, which can reduce resident memory usage with large schemas (#1217)
BUG FIXES:
- helper/resource: Prevented build errors with type aliasing added in v2.26.0 (#1176)
NOTES:
- This Go module has been updated to Go 1.19 per the Go support policy. Any consumers building on earlier Go versions may experience errors. (#1163)
- helper/resource: Deprecated
PrefixedUniqueId()
andUniqueId()
. Use thehelper/id
package instead. These deprecations are to assist in migrating to terraform-plugin-testing (#1167) - helper/resource: Deprecated
RetryContext()
,StateChangeConf
, and associated*Error
types. Use thehelper/retry
package instead. These deprecations are to assist in migrating to terraform-plugin-testing (#1167)
ENHANCEMENTS:
- helper/id: New
helper/id
package added.resource.PrefixedUniqueId()
andresource.UniqueId()
are deprecated,helper/id
should be used instead.helper/resource
now contains aliases to the migrated code (#1167) - helper/retry: New
helper/retry
package added.resource.RetryContext()
,resource.StateChangeConf
, and associated*Error
types are deprecated,helper/retry
should be used instead. `helper/resource now contains aliases to the migrated code (#1167)
BUG FIXES:
- helper/schema: Allow diagnostic messages with incorrect UTF-8 encoding to pass through with the invalid sequences replaced with the Unicode Replacement Character. This avoids returning the unhelpful message "string field contains invalid UTF-8" in that case. (#1111)
- helper/schema: Prevented unexpected difference for timeouts on first plan after import (#1146)
BUG FIXES:
- helper/resource: Fixed
TestStep
typeImportStateCheck
field so that it only matches against resources following a change in behaviour in Terraform 1.3 that imports both resources and data sources into state (#1089) - helper/resource: Prevented go-plugin goroutine leak per Terraform command (#1095)
- helper/resource: Prevented goroutine leak per Terraform command when testing terraform-plugin-sdk based providers via
Providers
orProviderFactories
(#1091) - helper/resource: Prevented provider configuration already given error when
TestStep
typeConfig
field already contained provider configuration block (#1092)
ENHANCEMENTS:
- helper/resource: Added
TestStep
typeRefreshState
field, which enables a step that refreshes state without an explicit apply or configuration changes (#1070)
BUG FIXES:
- helper/resource: Fixed
TestStep
typeImportStateVerify
field so that it only matches against resources following a change in behaviour in Terraform 1.3 that imports both resources and their dependent data sources (#1077)
ENHANCEMENTS:
- helper/resource: Added Terraform configuration to
TRACE
logging (#1059) - helper/resource: Added
terraform plan
output toTRACE
logging (#1058)
BUG FIXES:
- helper/resource: Prevented
Inconsistent dependency lock file
errors when usingExternalProviders
outside thehashicorp
namespace (#1057)
ENHANCEMENTS:
- helper/resource: Add ImportStatePersist to optionally persist state generated during import (#1052)
BUG FIXES:
- helper/schema: Delayed deprecated attribute warnings for unknown values, which may be null (#1047)
- helper/schema: Included path information in list size diagnostics for cases where Terraform does not include the configuration source (#826)
NOTES:
- This Go module has been updated to Go 1.18 per the Go support policy. Any consumers building on earlier Go versions may experience errors. (#1027)
BUG FIXES:
- helper/resource: Fixed
TestStep
typeTaint
field usage to properly recreate resources (#1031) - helper/schema: Ensured
RawConfig
,RawPlan
, andRawState
are correctly copied during planning with recreation (#1024)
NOTES:
- helper/logging: Existing
NewTransport()
is now deprecated in favour of using the newNewLoggingHTTPTransport()
orNewSubsystemLoggingHTTPTransport()
(#1006)
FEATURES:
- helper/logging: New
NewLoggingHTTPTransport()
andNewSubsystemLoggingHTTPTransport()
functions, providinghttp.RoundTripper
Transport implementations that log request/response using terraform-plugin-log (#546) (#1006)
NOTES:
- The underlying
terraform-plugin-log
dependency has been updated to v0.6.0, which includes log filtering support and breaking changes ofWith()
toSetField()
function names. Any provider logging which calls those functions may require updates. (#1003)
ENHANCEMENTS:
- helper/resource: Added
TF_ACC_LOG
,TF_LOG_CORE
, andTF_LOG_PROVIDER
environment variable handling for Terraform versions 0.15 and later (#993) - helper/schema: Added sdk.proto logger request duration and response diagnostics logging (#996)
BUG FIXES:
- helper/resource: Ensured errors are always logged. (#983)
NOTES:
- helper/resource: Provider references or external installation can now be handled at either the
TestCase
orTestStep
level. Using theTestStep
handling, advanced use cases are now enabled such as state upgrade acceptance testing. (#972)
ENHANCEMENTS:
- helper/resource: Added
TestStep
typeExternalProviders
,ProtoV5ProviderFactories
,ProtoV6ProviderFactories
, andProviderFactories
fields (#972)
BUG FIXES:
- helper/resource: Removed extraneous
terraform state show
command when not using theTestStep
typeTaint
field (#972)
ENHANCEMENTS:
- helper/resource: Added error logging before failing tests, so errors are visible in test output and any separate log file (#958)
BUG FIXES:
- helper/resource: Updated version of hc-install in response to change in HashiCorp Release API sending back a different
Content-Type
header. This was causing failures when the SDK attempted to install Terraform. (#960)
FEATURES:
- helper/resource: New
TestCheckResourceAttrWith
test helper, that simplifies checking of attribute values via custom functions (#950)
ENHANCEMENTS:
- helper/schema: Propagated
tf_data_source_type
,tf_req_id
,tf_resource_type
, andtf_rpc
fields in log entries (#955)
BUG FIXES:
- helper/resource: Prevented
Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
warning logs during acceptance testing (#955)
NOTES:
- This Go module has been updated to Go 1.17 per the Go support policy. Any consumers building on earlier Go versions may experience errors. (#934)
BUG FIXES:
- helper/resource: Ensured Terraform CLI logs are written to
TF_LOG_PATH_MASK
environment variable value when bothTF_ACC_LOG_PATH
andTF_LOG_PATH_MASK
are set (#938) - helper/resource: Ensured
@caller
in SDK logging entries accurately reflected calling code location (#939) - helper/resource: Prevented regression since 2.13.0 with the removal of environment variables, including
TF_VAR_*
, when calling Terraform CLI commands (#937) - helper/schema: Ensured
@caller
in SDK logging entries accurately reflected calling code location (#939) - helper/schema: Prevented missing SDK logging entries and confusing provider.stdio TRACE logging entries (#936)
NOTES:
- helper/resource: False positive checks of list, map, and set attributes with
TestCheckNoResourceAttr
andTestCheckResourceAttrSet
will now return an error to explain how to accurately check those types of attributes. Some previously passing tests will now fail until the check is correctly updated. (#920) - helper/schema: Any returned non-
nil
error
with anError()
method that returns an empty string (""
), will now return an error diagnostic with an"Empty Error String"
summary instead of a panic. Enabling Terraform logging at theWARN
level (e.g.TF_LOG=WARN terraform apply
) can help locate the problematic error by searching for thedetected empty error string
log message. (#914)
ENHANCEMENTS:
- helper/resource: Added error when errantly checking list, map, or set attributes in
TestCheckNoResourceAttr
,TestCheckResourceAttr
, andTestCheckResourceAttrSet
(#920) - helper/resource: Execute Terraform CLI commands during acceptance testing with
CHECKPOINT_DISABLE=1
set, removing extraneous calls to checkpoint.hashicorp.com to check for latest Terraform CLI version (#913)
BUG FIXES:
- helper/schema: Allowed
Schema
withTypeInt
to acceptstring
values fromDefaultFunc
, such asEnvDefaultFunc
(#841) (#841) - helper/schema: Prevented panics during
error
to diagnostic conversion for a non-nil
error with anError()
method that returns an empty string (""
) (#914) - helper/validation: Prevented panics with
ToDiagFunc()
function when used insideSchema
typeElem
field, such as validatingTypeList
elements (#915)
ENHANCEMENTS:
- helper/resource: Support JSON in
TestStep
typeConfig
field (#722)
BUG FIXES:
- customdiff: Prevented unexpected non-existent key errors in
ComputedIf
,ForceNewIf
, andForceNewIfChange
since 2.11.0, using a warning log for backwards compatibility instead (#909)
NOTES:
- The underlying
terraform-plugin-log
dependency has been updated to v0.3.0, which includes a breaking change in the optional additional fields parameter of logging function calls to ensure correctness and catch coding errors during compilation. Any early adopter provider logging which calls those functions may require updates. (#900) - helper/resource: The new terraform-plugin-log
sdk.helper_resource
logger inherits theTF_LOG
,TF_LOG_PATH_MASK
, andTF_ACC_LOG_PATH
environment variable settings, similar to the prior logging. TheTF_LOG_SDK_HELPER_RESOURCE
environment variable can be used to separately control the new logger level. (#891) - helper/schema: Started using terraform-plugin-log to write some SDK-level logs. Very few logs use this functionality now, but in the future, the environment variable
TF_LOG_SDK_HELPER_SCHEMA
will be able to set the log level for the SDK separately from the provider. (#837) - helper/schema: The
Schema
typeDiffSuppressOnRefresh
field opts in to usingDiffSuppressFunc
to detect normalization changes during refresh, using the same rules as for planning. This can prevent normalization cascading downstream and producing confusing changes in other resources, and will avoid reporting "Values changed outside of Terraform" for normalization-only situations. This is a desirable behavior for most attributes that haveDiffSuppressFunc
and so would ideally be on by default, but it is opt-in for backward compatibility reasons. (#882) - plugin: The
Debug
function has been deprecated in preference of setting theDebug
field in theServeOpts
passed into theServe
function. (#857)
ENHANCEMENTS:
- helper/resource: Added more visible logging for test steps skipped via the
TestStep
typeSkipFunc
field. (#889) - helper/resource: Added terraform-plugin-log
sdk.helper_resource
logger and extensiveTRACE
log entries (#891) - helper/schema: Added the
DiffSuppressOnRefresh
field to theSchema
type (#882) - plugin: Added support for writing protocol data to disk by setting
TF_LOG_SDK_PROTO_DATA_DIR
environment variable (#857) - plugin: Increased maximum gRPC send and receive message size limit to 256MB (#857)
BUG FIXES:
- helper/resource: Removed extraneous Terraform CLI
show
command eachTestStep
unless usingTestCase.IDRefreshName
(#892) - plugin: Prevent potential process leak on Windows platforms (#856)
BUG FIXES:
- helper/schema: Fixed regression from version 2.9.0 in
(ResourceDiff).GetChangedKeysPrefix()
where passing an empty string (""
) would no longer return all changed keys (#829)
NOTES:
- helper/resource: Previously, TF_ACC_LOG_PATH would not enable logging for the provider under test. This has been fixed, so logging from the Terraform binary, any external providers, and the provider under test will all be combined in a file at the specified path.
ENHANCEMENTS:
NOTES:
- helper/schema: Added warning log for provider reconfiguration, which can occur with concurrent testing and cause unexpected testing results when there are differing provider configurations. To prevent this warning, testing should create separate provider instances for separate configurations. Providers can further implement
sync.Once
to prevent reconfiguration effects or add an execution tracking variable inProvider.ConfigureFunc
orProvider.ConfigureContextFunc
implementations to raise errors, if desired. (#636)
ENHANCEMENTS:
- helper/resource: Added timing logging to sweepers (#782)
- helper/resource: Updated terraform-exec to work with Terraform 1.1 (#822)
BUG FIXES:
- helper/acctest: Prevent duplicate values from
RandInt()
,RandIntRange()
, andRandomWithPrefix()
invocations on platforms with less granular clocks (#764) - helper/schema: Prevent potential panics with
(*ResourceData).HasChangeExcept()
and(*ResourceData).HasChangesExcept()
(#811) - helper/schema: Remove
TypeSet
truncation warning logs if none are truncated (#767) - helper/schema: Ensure
(*ResourceDiff).SetNew()
and(*ResourceDiff).SetNewComputed()
only remove planned differences from exact or nested attribute and block names instead of any name with the same prefix (#716) - helper/schema: Fix deep equality checks with
(*ResourceData).HasChange()
,(*ResourceData).HasChanges()
,(*ResourceData).HasChangeExcept()
, and(*ResourceData).HasChangesExcept()
(#711) - helper/schema: Prevent potential panics since v2.8.0 with data sources that have optional attributes and no practitioner configuration (#815)
NOTES:
- Updated to terraform-plugin-go v0.4.0. Users of terraform-plugin-mux will need to upgrade terraform-plugin-mux as well.
ENHANCEMENTS:
- Added experimental support for retrieving underlying raw protocol values from
helper/schema.ResourceData
andhelper/schema.ResourceDiff
, bypassing the shims. (#802)
BUG FIXES:
- helper/schema: Ensure
Provider.ConfigureContextFunc
warning-only diagnostics are returned (#791)
ENHANCEMENTS:
- Added
ProtoV6ProviderFactories
toTestCase
, so protocol version 6 providers can be used in acceptance tests (#761) - Made SDK-generated diagnostics clearer and more consistent (#755)
- Upgraded to use terraform-exec v0.14.0, which is required for acceptance test compatibility with Terraform v1.0.1 (#775)
BUG FIXES:
- Updated the GPG key used to verify Terraform installs in response to the Terraform GPG key rotation. (#750)
ENHANCEMENTS:
- Made TF_ACC_TERRAFORM_VERSION more permissive, accepting values in either vX.Y.Z or X.Y.Z formats. (#731)
- Upgraded to use terraform-plugin-go v0.3.0 (#739)
ENHANCEMENTS
- Added the ability to opt out of context timeouts in CRUD functions (#723)
NOTES
As per our Go version support policy, we now require Go 1.15 or higher to use the SDK.
BUG FIXES
- Resolved bug where Diagnostics wouldn't get associated with their configuration context in user output. (#696)
BUG FIXES
- Make acceptance testing framework compatible with Terraform 0.15 (#694)
BUG FIXES
- Don't panic in very specific circumstances involving CustomizeDiff and empty strings in the config (#686)
BUG FIXES
- Don't panic during assertions when testing sets with varying levels of nesting (#648)
- Prevent panics when sending Ctrl-C to Terraform (#674)
- Make the error message when a "required" block is missing clearer, identifying the block in question (#672)
ENHANCEMENTS
- Support
Unwrap
on SDK errors (#647) - Allow for
nil
errors indiag.FromErr
(#623) - Added
validation.ToDiagFunc
helper to translate legacy validation functions into Diagnostics-aware validation functions. (#611) - Disable Checkpoint network connections during acceptance testing unless a Terraform binary needs to be installed. (#663)
BUG FIXES
- Check for
nil
errors prior to invokingErrorCheck
(#646) - More reliable handling of logging (#639)
- Modified error text to make golint and go vet happy when a non-empty plan is found in testing and an empty plan was expected (#596)
- Add
UseJSONNumber
tohelper/schema.Resource
to make it possible to represent large numbers precisely. Setting totrue
will make numbers appear asjson.Number
inStateUpgrader
s instead of asfloat64
. (#662) - Fix logs sometimes appearing in test output when running acceptance tests. (#665)
NOTES
We have removed the deprecation of the non-diagnostic version of validation until the build-in validations are ported to the new format.
ENHANCEMENTS
helper/schema.ResourceData
now hasHasChangeExcept
andHasChangesExcept
methods to check if the resource has changes besides a given key or list of keys. (#558)helper/resource.TestCase
now has anErrorCheck
property that can be set to a function, allowing the programmatic determination of whether to ignore an error or not. (#592)
FEATURES
- Updated to use the new
terraform-plugin-go
library as a foundation for the SDK, enabling it to be used withterraform-plugin-mux
(#630) - Added the
TestCase.ProtoV5ProviderFactories
property to allow testing providers created withterraform-plugin-go
with thehelper/resource
test framework. (#630)
FEATURES
- Relaxed validation in
InternalValidate
for explicitly setid
attributes (#613) - Ported TypeSet test check funcs essential for migrating to V2 of the SDK (#614)
- Improved debug output for how to manually invoke the Terraform CLI (#615)
BUG FIXES
- Fix a bug that would pass the post-destroy state to
helper/resource.TestCase.CheckDestroy
instead of the documented pre-destroy state (#591) - Clean up the final remaining places where test numbers or dangling resources warnings could be omitted from errors (#578)
- Stop considering plans empty when they include data source changes (#594)
BUG FIXES
- Fixed a bug that would incorrectly mark tests using TestStep.ImportStateVerify as failed if they tested a resource with custom timeouts (#576)
- Fixed a bug where errors destroying infrastructure after tests wouldn't be reported (#581)
- Fixed a bug where test steps that expected a non-empty plan would fail because they had an empty plan, erroneously (#580)
- Fixed a bug where the plan output shown when an unexpected diff was encountered during testing would be shown in JSON instead of a human-readable format (#584)
BUG FIXES
- Fixed bug where state is read from the wrong workspace during import tests. (#552)
- Fixed bug where the resource could belong to another provider when finding the resource state to check during import tests (#522)
- Removed excessive logging when ExpectNonEmptyPlan was successfully matched (#556)
- Fixed bug where state from data sources, which can't be imported, would be surfaced during ImportStateVerify (#555)
- Fixed bug that ignored ExpectError when testing state imports (#550)
- Fixed bug that sometimes prevented TestStep numbers from appearing in error output (#557)
- Fixed bug that would ignore
TestStep.Destroy
when running tests. (#563)
BUG FIXES
- Restored reporting of failed test step number (#524)
- Restored output of a test that failed with unexpected diff to V1 style output (#526)
FEATURES
- Provide deprecated method for receiving a global context that receives stop cancellation. (#502)
- Support multiple providers in reattach mode (#512)
- Allow setting
ExternalProviders
inresource.TestCase
to control what providers are downloaded withterraform init
for a test. (#516) - Restore
resource.TestEnvVar
(#519)
BUG FIXES
- Remove deprecation warnings which cause spam and crashes in provider acceptance tests. (#503)
- Fixed a bug in the test driver that caused errors for Windows users on versions of Terraform below 0.13.0-beta2. (#499)
- Fixed a bug in the test driver that caused timeouts when using the
IDRefreshName
onresource.TestCase
s. (#501) - Fixed a bug where data sources would not always reflect changes in their configs in the same
resource.TestStep
that the config changed. (#515) - Fixed a bug that would prevent errors from being handled by ExpectError handlers during testing. (#518)
FEATURES
- The test driver was reworked to allow for test coverage, race detection, and debugger support. (#471)
- A new
plugin.Debug
function allows starting the provider in a standalone mode that's compatible with debuggers, and outputs information on how to drive the standalone provider with Terraform. (#471)
BREAKING CHANGES
- Removed the
helper/mutexkv
,helper/pathorcontents
,httpclient
, andhelper/hashcode
packages. These packages can be easily replicated in plugin code if necessary or the v1 versions can be used side-by-side (#438) - Removed
schema.PanicOnErr/TF_SCHEMA_PANIC_ON_ERR
environment variable.d.Set()
errors are now logged in production and panic during acceptance tests (TF_ACC=1
). (#462) - Running provider tests now requires Terraform 0.12.26 or higher. (#471)
- Removed
acctest
package, as it is no longer needed. The calls toacctest.UseBinaryDriver
can be deleted; they're no longer necessary. (#471) - The
resource.TestCase.Providers
andresource.TestCaseProviderFactories
maps must now have exactly one entry set between both of them, meaning one or the other should be used. Only the provider under test should be present in these maps. Providers that tests rely upon can be used by setting provider blocks in the test case, whereterraform init
will pick them up automatically. (#471) - The
TF_LOG_PATH_MASK
used to filter provider logs by test name when running tests has been removed. (#473)
ENHANCEMENTS
- Added a
schema.Provider.UserAgent
method to generate a User-Agent string (#474) - Convenience methods were added to the
diag
package to simplify common error cases (#449)
BUG FIXES
- Restored
d.Partial
and noted the edgecase it covers and odd Terraform behavior. (#472) - Provider log output now respects the
TF_LOG
andTF_LOG_PATH
environment variables when running tests. (#473)
BREAKING CHANGES
-
The SDK no longer supports protocol 4 (Terraform 0.11 and below). Providers built on the SDK after v2 will need Terraform 0.12 to be used.
-
The new, previously optional binary acceptance testing framework is now the default and only available mode for testing. Test code and provider code will no longer reside in the same process. Providers also will have their processes stopped and restarted multiple times during a test. This more accurately mirrors the behavior of providers in production.
-
Updated type signatures for some functions to include context.Context support. These include helpers in the helper/customdiff package, the CustomizeDiffFunc type, and the StateUpgradeFunc type. (#276)
-
The Partial and SetPartial methods on schema.ResourceData have been removed, as they were rarely necessary and poorly understood. (#318)
-
The terraform.ResourceProvider interface has been removed. The *schema.Provider type should be used directly, instead. (#316)
-
Deprecated helper/validation functions have been removed. (#333)
-
PromoteSingle’s use is discouraged, and so it has been removed from helper/schema.Schema. (#337)
-
schema.UnsafeSetFieldRaw’s use is discouraged, and so it has been removed. (#339)
-
Calls to schema.ResourceData.Set that would return an error now panic by default. TF_SCHEMA_PANIC_ON_ERROR can be set to a falsey value to disable this behavior.
-
schema.Resource.Refresh has been removed, as it is unused in protocol 5. (#370)
-
The Removed field has been removed from helper/schema.Schema, which means providers can no longer specify error messages when a recently removed field is used. This functionality had a lot of bugs and corner cases that worked in unexpected ways, and so was removed. (#414)
-
The helper/encryption package has been removed, following our published guidance. (#436)
-
In scenarios where the Go testing package was used, the github.com/mitchellh/go-testing-interface package may be required instead. (#406)
-
A number of exported variables, functions, types, and interfaces that were not meant to be part of the SDK’s interface have been removed. Most plugins should not notice they are gone.
The removals include:
- helper/acctest.RemoteTestPrecheck
- helper/acctest.SkipRemoteTestsEnvVar
- helper/resource.EnvLogPathMask
- helper/resource.GRPCTestProvider
- helper/resource.LogOutput
- helper/resource.Map
- helper/resource.TestEnvVar
- helper/resource.TestProvider
- helper/schema.MultiMapReader
- helper/schema.Provider.Input
- plugin.Client
- plugin.ClientConfig
- plugin.DefaultProtocolVersion
- plugin.GRPCProvider
- plugin.GRPCProviderPlugin
- plugin.GRPCProvisioner
- plugin.GRPCProvisionerPlugin
- plugin.HandShake.ProtocolVersion
- plugin.ResourceProvider
- plugin.ResourceProviderApplyArgs
- plugin.ResourceProviderApplyResponse
- plugin.ResourceProviderConfigureResponse
- plugin.ResourceProviderDiffArgs
- plugin.ResourceProviderDiffResponse
- plugin.ResourceProviderGetSchemaArgs
- plugin.ResourceProviderGetSchemaResponse
- plugin.ResourceProviderImportStateArgs
- plugin.ResourceProviderImportStateResponse
- plugin.ResourceProviderInputArgs
- plugin.ResourceProviderInputResponse
- plugin.ResourceProviderPlugin
- plugin.ResourceProviderReadDataApplyArgs
- plugin.ResourceProviderReadDataApplyResponse
- plugin.ResourceProviderReadDataDiffArgs
- plugin.ResourceProviderReadDataDiffResponse
- plugin.ResourceProviderRefreshArgs
- plugin.ResourceProviderRefreshResponse
- plugin.ResourceProviderServer
- plugin.ResourceProviderStopResponse
- plugin.ResourceProviderValidateArgs
- plugin.ResourceProviderValidateResourceArgs
- plugin.ResourceProviderValidateResourceResponse
- plugin.ResourceProviderValidateResponse
- plugin.UIInput
- plugin.UIInputInputResponse
- plugin.UIInputServer
- plugin.UIOutput
- plugin.UIOutputServer
- plugin.VersionedPlugins no longer has a "provisioner" key
- resource.RunNewTest
- schema.Backend
- schema.FromContextBackendConfig
- schema.SetProto5
- terraform.ApplyGraphBuilder
- terraform.AttachResourceConfigTransformer
- terraform.AttachSchemaTransformer
- terraform.AttachStateTransformer
- terraform.BackendState.Config
- terraform.BackendState.Empty
- terraform.BackendState.ForPlan
- terraform.BackendState.SetConfig
- terraform.BasicGraphBuilder
- terraform.BuiltinEvalContext
- terraform.CallbackUIOutput
- terraform.CBDEdgeTransformer
- terraform.CheckCoreVersionRequirements
- terraform.CloseProviderEvalTree
- terraform.CloseProviderTransformer
- terraform.CloseProvisionerTransformer
- terraform.ConcreteProviderNodeFunc
- terraform.ConcreteResourceInstanceDeposedNodeFunc
- terraform.ConcreteResourceInstanceNodeFunc
- terraform.ConcreteResourceNodeFunc
- terraform.ConfigTransformer
- terraform.ConfigTreeDependencies
- terraform.ConnectionBlockSupersetSchema
- terraform.Context
- terraform.ContextGraphOpts
- terraform.ContextGraphWalker
- terraform.ContextMeta
- terraform.ContextOpts
- terraform.CountBoundaryTransformer
- terraform.DefaultVariableValues
- terraform.DestroyEdge
- terraform.DestroyEdgeTransformer
- terraform.DestroyOutputTransformer
- terraform.DestroyPlanGraphBuilder
- terraform.DestroyValueReferenceTransformer
- terraform.Diff (this was eventually cut)
- terraform.Diff.ModuleByPath
- terraform.Diff.RootModule
- terraform.DiffAttrInput
- terraform.DiffAttrOutput
- terraform.DiffAttrType
- terraform.DiffAttrUnknown
- terraform.DiffChangeType
- terraform.DiffCreate
- terraform.DiffDestroy
- terraform.DiffDestroyCreate
- terraform.DiffInvalid
- terraform.DiffNone
- terraform.DiffRefresh
- terraform.DiffTransformer
- terraform.DiffUpdate
- terraform.EphemeralState.DeepCopy
- terraform.ErrNoState
- terraform.Eval
- terraform.EvalApply
- terraform.EvalApplyPost
- terraform.EvalApplyPre
- terraform.EvalApplyProvisioners
- terraform.EvalCheckModuleRemoved
- terraform.EvalCheckPlannedChange
- terraform.EvalCheckPreventDestroy
- terraform.EvalCloseProvider
- terraform.EvalCloseProvisioner
- terraform.EvalConfigBlock
- terraform.EvalConfigExpr
- terraform.EvalConfigProvider
- terraform.EvalContext
- terraform.EvalCountFixZeroOneBoundaryGlobal
- terraform.EvalDataForInstanceKey
- terraform.EvalDataForNoInstanceKey
- terraform.EvalDeleteLocal
- terraform.EvalDeleteOutput
- terraform.EvalDeposeState
- terraform.EvalDiff
- terraform.EvalDiffDestroy
- terraform.EvalEarlyExitError
- terraform.EvalFilter
- terraform.EvalForgetResourceState
- terraform.EvalGetProvider
- terraform.EvalGetProvisioner
- terraform.EvalGraphBuilder
- terraform.EvalIf
- terraform.EvalImportState
- terraform.EvalImportStateVerify
- terraform.EvalInitProvider
- terraform.EvalInitProvisioner
- terraform.EvalLocal
- terraform.EvalMaybeRestoreDeposedObject
- terraform.EvalMaybeTainted
- terraform.EvalModuleCallArgument
- terraform.EvalNode
- terraform.EvalNodeFilterable
- terraform.EvalNodeFilterFunc
- terraform.EvalNodeFilterOp
- terraform.EvalNodeOpFilterable
- terraform.EvalNoop
- terraform.EvalOpFilter
- terraform.EvalRaw
- terraform.EvalReadData
- terraform.EvalReadDataApply
- terraform.EvalReadDiff
- terraform.EvalReadState
- terraform.EvalReadStateDeposed
- terraform.EvalReduceDiff
- terraform.EvalRefresh
- terraform.EvalRequireState
- terraform.EvalReturnError
- terraform.EvalSequence
- terraform.EvalSetModuleCallArguments
- terraform.Evaluator
- terraform.EvalUpdateStateHook
- terraform.EvalValidateCount
- terraform.EvalValidateProvider
- terraform.EvalValidateProvisioner
- terraform.EvalValidateResource
- terraform.EvalValidateSelfRef
- terraform.EvalWriteDiff
- terraform.EvalWriteOutput
- terraform.EvalWriteResourceState
- terraform.EvalWriteState
- terraform.EvalWriteStateDeposed
- terraform.ExpandTransform
- terraform.ForcedCBDTransformer
- terraform.Graph
- terraform.GraphBuilder
- terraform.GraphDot
- terraform.GraphNodeAttachDestroyer
- terraform.GraphNodeAttachProvider
- terraform.GraphNodeAttachProviderConfigSchema
- terraform.GraphNodeAttachProvisionerSchema
- terraform.GraphNodeAttachResourceConfig
- terraform.GraphNodeAttachResourceSchema
- terraform.GraphNodeAttachResourceState
- terraform.GraphNodeCloseProvider
- terraform.GraphNodeCloseProvisioner
- terraform.GraphNodeCreator
- terraform.GraphNodeDeposedResourceInstanceObject
- terraform.GraphNodeDeposer
- terraform.GraphNodeDestroyer
- terraform.GraphNodeDestroyerCBD
- terraform.GraphNodeDynamicExpandable
- terraform.GraphNodeEvalable
- terraform.GraphNodeExpandable
- terraform.GraphNodeProvider
- terraform.GraphNodeProviderConsumer
- terraform.GraphNodeProvisioner
- terraform.GraphNodeProvisionerConsumer
- terraform.GraphNodeReferenceable
- terraform.GraphNodeReferenceOutside
- terraform.GraphNodeReferencer
- terraform.GraphNodeResource
- terraform.GraphNodeResourceInstance
- terraform.GraphNodeSubgraph
- terraform.GraphNodeSubPath
- terraform.GraphNodeTargetable
- terraform.GraphNodeTargetDownstream
- terraform.GraphTransformer
- terraform.GraphTransformIf
- terraform.GraphTransformMulti
- terraform.GraphType
- terraform.GraphTypeApply
- terraform.GraphTypeEval
- terraform.GraphTypeInvalid
- terraform.GraphTypeLegacy
- terraform.GraphTypeMap
- terraform.GraphTypePlan
- terraform.GraphTypePlanDestroy
- terraform.GraphTypeRefresh
- terraform.GraphTypeValidate
- terraform.GraphVertexTransformer
- terraform.GraphWalker
- terraform.Hook
- terraform.HookAction
- terraform.HookActionContinue
- terraform.HookActionHalt
- terraform.ImportGraphBuilder
- terraform.ImportOpts
- terraform.ImportProviderValidateTransformer
- terraform.ImportStateTransformer
- terraform.ImportTarget
- terraform.InputMode
- terraform.InputModeProvider
- terraform.InputModeStd
- terraform.InputModeVar
- terraform.InputModeVarUnset
- terraform.InputOpts
- terraform.InputValue
- terraform.InputValues
- terraform.InputValuesFromCaller
- terraform.InstanceDiff.Copy
- terraform.InstanceDiff.DelAttribute
- terraform.InstanceDiff.GetAttributesLen
- terraform.InstanceDiff.SetAttribute
- terraform.InstanceDiff.SetDestroy
- terraform.InstanceDiff.SetDestroyDeposed
- terraform.InstanceDiff.SetTainted
- terraform.InstanceInfo.ResourceAddress
- terraform.InstanceKeyEvalData
- terraform.InstanceType
- terraform.LoadSchemas
- terraform.LocalTransformer
- terraform.MissingProviderTransformer
- terraform.MissingProvisionerTransformer
- terraform.MockEvalContext
- terraform.MockHook
- terraform.MockProvider
- terraform.MockProvisioner
- terraform.MockResourceProvider (this was removed)
- terraform.MockResourceProvider.Input
- terraform.MockResourceProvider.InputCalled
- terraform.MockResourceProvider.InputConfig
- terraform.MockResourceProvider.InputFn
- terraform.MockResourceProvider.InputInput
- terraform.MockResourceProvider.InputReturnConfig
- terraform.MockResourceProvider.InputReturnError
- terraform.MockResourceProvisioner
- terraform.MockUIInput
- terraform.MockUIOutput
- terraform.ModuleDiff (this was eventually cut)
- terraform.ModuleDiff.IsRoot
- terraform.ModuleState.Empty
- terraform.ModuleState.IsDescendent
- terraform.ModuleState.IsRoot
- terraform.ModuleState.Orphans
- terraform.ModuleState.RemovedOutputs
- terraform.ModuleState.View
- terraform.ModuleVariableTransformer
- terraform.MustShimLegacyState
- terraform.NewContext
- terraform.NewInstanceInfo
- terraform.NewLegacyResourceAddress
- terraform.NewLegacyResourceInstanceAddress
- terraform.NewNodeAbstractResource
- terraform.NewNodeAbstractResourceInstance
- terraform.NewReferenceMap
- terraform.NewResource
- terraform.NewSemaphore
- terraform.NilHook
- terraform.NodeAbstractProvider
- terraform.NodeAbstractResource
- terraform.NodeAbstractResourceInstance
- terraform.NodeApplyableModuleVariable
- terraform.NodeApplyableOutput
- terraform.NodeApplyableProvider
- terraform.NodeApplyableResource
- terraform.NodeApplyableResourceInstance
- terraform.NodeCountBoundary
- terraform.NodeDestroyableDataResourceInstance
- terraform.NodeDestroyableOutput
- terraform.NodeDestroyDeposedResourceInstanceObject
- terraform.NodeDestroyResource
- terraform.NodeDestroyResourceInstance
- terraform.NodeDisabledProvider
- terraform.NodeEvalableProvider
- terraform.NodeLocal
- terraform.NodeModuleRemoved
- terraform.NodeOutputOrphan
- terraform.NodePlanDeposedResourceInstanceObject
- terraform.NodePlanDestroyableResourceInstance
- terraform.NodePlannableResource
- terraform.NodePlannableResourceInstance
- terraform.NodePlannableResourceInstanceOrphan
- terraform.NodeProvisioner
- terraform.NodeRefreshableDataResource
- terraform.NodeRefreshableDataResourceInstance
- terraform.NodeRefreshableManagedResource
- terraform.NodeRefreshableManagedResourceInstance
- terraform.NodeRootVariable
- terraform.NodeValidatableResource
- terraform.NullGraphWalker
- terraform.OrphanOutputTransformer
- terraform.OrphanResourceCountTransformer
- terraform.OrphanResourceInstanceTransformer
- terraform.OrphanResourceTransformer
- terraform.OutputTransformer
- terraform.ParentProviderTransformer
- terraform.ParseInstanceType
- terraform.ParseResourceAddress
- terraform.ParseResourceAddressForInstanceDiff
- terraform.ParseResourceIndex
- terraform.ParseResourcePath
- terraform.ParseResourceStateKey
- terraform.PathObjectCacheKey
- terraform.Plan
- terraform.PlanGraphBuilder
- terraform.PrefixUIInput
- terraform.ProviderConfigTransformer
- terraform.ProviderEvalTree
- terraform.ProviderHasDataSource
- terraform.ProviderHasResource
- terraform.ProviderSchema.SchemaForResourceAddr
- terraform.ProviderSchema.SchemaForResourceType
- terraform.ProviderTransformer
- terraform.ProvisionerFactory
- terraform.ProvisionerTransformer
- terraform.ProvisionerUIOutput
- terraform.PruneProviderTransformer
- terraform.PruneUnusedValuesTransformer
- terraform.ReadPlan
- terraform.ReadState
- terraform.ReadStateV1
- terraform.ReadStateV2
- terraform.ReadStateV3
- terraform.ReferenceMap
- terraform.ReferencesFromConfig
- terraform.ReferenceTransformer
- terraform.RefreshGraphBuilder
- terraform.RemoteState.Equals
- terraform.RemovableIfNotTargeted
- terraform.RemovedModuleTransformer
- terraform.Resource
- terraform.ResourceAddress
- terraform.ResourceAttrDiff.Empty
- terraform.ResourceConfig.CheckSet
- terraform.ResourceConfig.IsSet
- terraform.ResourceCountTransformer
- terraform.ResourceFlag
- terraform.ResourceProviderCloser (this was removed)
- terraform.ResourceProviderFactoryFixed (this was removed)
- terraform.ResourceProviderResolver
- terraform.ResourceProviderResolverFixed
- terraform.ResourceProviderResolverFunc
- terraform.ResourceProvisioner
- terraform.ResourceProvisionerCloser
- terraform.ResourceProvisionerFactory
- terraform.RootTransformer
- terraform.RootVariableTransformer
- terraform.Schemas
- terraform.Semaphore
- terraform.ShimLegacyState
- terraform.State.FromFutureTerraform
- terraform.State.MarshalEqual
- terraform.StateFilter
- terraform.StateFilterResult
- terraform.StateFilterResultSlice
- terraform.StateTransformer
- terraform.StateVersion
- terraform.TargetsTransformer
- terraform.TestStateFile
- terraform.TransformProviders
- terraform.TransitiveReductionTransformer
- terraform.TypeDeposed
- terraform.TypeInvalid
- terraform.TypePrimary
- terraform.TypeTainted
- terraform.UIInput
- terraform.UIOutput
- terraform.UpgradeResourceState
- terraform.ValidateGraphBuilder
- terraform.ValueFromAutoFile
- terraform.ValueFromCaller
- terraform.ValueFromCLIArg
- terraform.ValueFromConfig
- terraform.ValueFromEnvVar
- terraform.ValueFromInput
- terraform.ValueFromNamedFile
- terraform.ValueFromPlan
- terraform.ValueFromUnknown
- terraform.ValueSourceType
- terraform.VertexTransformer
- terraform.WritePlan
- terraform.WriteState
FEATURES
- Many functions in the SDK now have support for context.Context, including CreateContextFunc, ReadContextFunc, UpdateContextFunc, and DeleteContextFunc, analogs to the existing CreateFunc, ReadFunc, UpdateFunc, and DeleteFuncs. This offers more accurate cancellation and timeouts. (#276)
- Many functions in the SDK now return a new diag.Diagnostics type, like the new CreateContextFunc, ReadContextFunc, UpdateContextFunc, DeleteContextFunc, and a new ValidateDiagFunc. When using these Diagnostics, Terraform will now indicate more precisely-scoped errors, and providers now have the ability to display warnings.
- A new feature, provider metadata, is shipping as part of Terraform 0.13. This feature allows module authors to give information to providers without the information being persisted to state, which is useful for indicating metadata about modules. This is experimental new functionality and its usage should be closely coordinated with the Terraform core team to ensure that limitations are understood. See the PR in Terraform core for more information. (#405)
DEPRECATIONS
- The ExistsFunc defined on a schema.Resource is now deprecated. This logic can be achieved in the ReadFunc for that schema.Resource instead, and often was duplicated unnecessarily.
- Functions that got context- or diagnostics-aware counterparts--like CreateFunc, ReadFunc, UpdateFunc, DeleteFunc, and ValidateFunc--are now deprecated in favor of their context- and/or diagnostics-aware counterparts.
ENHANCEMENTS
- A number of new map validators that take advantage of the Diagnostics support have been added. (#304)
- schema.Resource and schema.Schema now have optional Description fields, which will surface information for user-facing interfaces for the provider. These fields can hold plain text or markdown, depending on the global DescriptionKind setting. (#349)
BUG FIXES
- helper/acctest.RandIntRange will now correctly return an integer between min and max; previously, it would return an integer between 0 and max-min. (#300)
- NonRetryableError and RetryableError will now throw an explicit error if they’re given a nil error. Before unspecified and confusing behavior would arise. (#199)
- TypeSet hash values are no longer collapsed into a single value when they consist only of Computed attributes. (#197)
- Computed attributes now have stronger validation around what properties can be set on their schema.Schema. (#336)
- Using a schema.Resource as the Elem on a TypeMap now returns an error; previously, unspecified and confusing behavior was exhibited. (#338)
- Using TestCheckResourceAttrPair to compare the same attribute on the same resource will now throw an error. (#335)
- Test sweeping will now error if a dependency sweeper is specified but doesn’t exist. (#398)
For information on v1.x releases, please see the v1 branch changelog.