-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecated argument messages contain no context for which property is deprecated. #1094
Comments
Partially related: hashicorp/terraform#31575 |
Hi @RealOrangeOne 👋 Thank you for reporting this and sorry you ran into trouble here. Out of curiosity, is this something occurring in a recent Terraform version and is the configuration that generates this warning referencing the deprecated attribute, but not configuring it? Normally Terraform core should be showing the source line in the diagnostic, if the issue is caused by a configured attribute value. |
Ah ha, its an attribute under a set, which is why Terraform core is not showing the configuration source as it normally would. https://github.com/checkly/terraform-provider-checkly/blob/9328934dd9575d0b2af19d7f643cb9e0d5306461/checkly/resource_check_group.go#L209 This is a trickier case because the protocol between Terraform and providers does not currently support sets in diagnostic paths: https://github.com/hashicorp/terraform/blob/a574e95dcde2d3bbb399b025f515ccd062abeeca/docs/plugin-protocol/tfplugin5.3.proto#L43-L56 so a few things would require updates to properly have Terraform show or approximate the configuration source for this. A tactical fix in this very specific case would be having the top level More generally though, having the SDK output include the attribute path information in the diagnostic summary/detail is problematic outside top level attributes as it needs to be done in a manner that is understandable by both practitioners and provider developers. There is no configuration reference equivalent for indexing into a set, for example, as set types in Terraform are not considered indexable. terraform-plugin-framework takes an approach of stringifying the path by wrapping the whole value in its own syntax, e.g. it would be something like |
SDK version
N/A
Relevant provider source code
N/A
Terraform Configuration Files
N/A
Debug Output
N/A
Expected Behavior
When an argument is marked as deprecated, it should be obvious which attribute is deprecated. Perhaps with the message "Argument
foo
is deprecated".Actual Behavior
Unless the deprecation message itself contains a reference to which argument is deprecated (ie "The property
foo
is deprecated"), it's not obvious which field is deprecated. The SDK documentation examples don't mention to include the field name, and the example messages definitely don't.Steps to Reproduce
References
Example output:
The example here comes from the Checkly provider, but I believe this to be something better solved at the SDK level.
The text was updated successfully, but these errors were encountered: