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-Typeheader. This was causing failures when the SDK attempted to install Terraform. (#960)
v2.15.0
FEATURES:
- helper/resource: New
TestCheckResourceAttrWithtest 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_rpcfields in log entries (#955)
BUG FIXES:
- helper/resource: Prevented
Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger optionswarning 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_MASKenvironment variable value when bothTF_ACC_LOG_PATHandTF_LOG_PATH_MASKare set (#938) - helper/resource: Ensured
@callerin 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
@callerin 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
TestCheckNoResourceAttrandTestCheckResourceAttrSetwill 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-
nilerrorwith 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 theWARNlevel (e.g.TF_LOG=WARN terraform apply) can help locate the problematic error by searching for thedetected empty error stringlog 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=1set, removing extraneous calls to checkpoint.hashicorp.com to check for latest Terraform CLI version (#913)
BUG FIXES:
- helper/schema: Allowed
SchemawithTypeIntto acceptstringvalues fromDefaultFunc, such asEnvDefaultFunc(#841) (#841) - helper/schema: Prevented panics during
errorto diagnostic conversion for a non-nilerror with anError()method that returns an empty string ("") (#914) - helper/validation: Prevented panics with
ToDiagFunc()function when used insideSchematypeElemfield, such as validatingTypeListelements (#915)
v2.12.0
v2.11.0
NOTES:
- The underlying
terraform-plugin-logdependency 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_resourcelogger inherits theTF_LOG,TF_LOG_PATH_MASK, andTF_ACC_LOG_PATHenvironment variable settings, similar to the prior logging. TheTF_LOG_SDK_HELPER_RESOURCEenvironment 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_SCHEMAwill be able to set the log level for the SDK separately from the provider. (#837) - helper/schema: The
SchematypeDiffSuppressOnRefreshfield opts in to usingDiffSuppressFuncto 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 haveDiffSuppressFuncand so would ideally be on by default, but it is opt-in for backward compatibility reasons. (#882) - plugin: The
Debugfunction has been deprecated in preference of setting theDebugfield in theServeOptspassed into theServefunction. (#857)
ENHANCEMENTS:
- helper/resource: Added more visible logging for test steps skipped via the
TestSteptypeSkipFuncfield. (#889) - helper/resource: Added terraform-plugin-log
sdk.helper_resourcelogger and extensiveTRACElog entries (#891) - helper/schema: Added the
DiffSuppressOnRefreshfield to theSchematype (#882) - plugin: Added support for writing protocol data to disk by setting
TF_LOG_SDK_PROTO_DATA_DIRenvironment variable (#857) - plugin: Increased maximum gRPC send and receive message size limit to 256MB (#857)
BUG FIXES: