Releases: hashicorp/terraform-plugin-sdk
Releases · hashicorp/terraform-plugin-sdk
v2.16.0
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)
v2.15.0
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)
v2.14.0
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)
v2.13.0
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)
v2.12.0
v2.11.0
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: