You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When developing against an existing Terraform configuration which is pinned to older Terraform Provider versions, there can be arguments which are only available in newer Terraform Provider versions, e.g.
When developing a Terraform configuration using a Terraform Provider that has a Resource with multiple blocks, it is possible to incorrectly add an argument to the wrong nesting level, e.g.
Both of these will currently generate a generic HCL error such as:
$ terraform plan...Error: Unsupported argumenton main.tf line ##, in resource "example_thing" "example":34: newer_attribute = "example"An argument named "newer_attribute" is not expected here.
Terraform CLI and Terraform Provider repositories will occasionally receive new GitHub issues relating to this when typically there are two helpful recommendations:
Checking the provider version to ensure it is up to date
Checking the resource documentation
For newer practitioners or those unfamiliar with why they might be receiving this error, it might be helpful to include some of this additional troubleshooting information with the error message.
Proposal
For resource arguments, catch and wrap the HCL error message with some additional Terraform context:
Error: Unsupported argument
on main.tf line ##, in resource "example_thing" "example":
34: newer_attribute = "example"
An argument named "newer_attribute" is not expected here. Use the resource documentation to verify that this resource supports this argument and that the provider version being used with this configuration is up to date with the expected resource functionality.
The same could theoretically be tailored and applied for provider arguments as well.
Current Terraform Version
Use-cases
Both of these will currently generate a generic HCL error such as:
Terraform CLI and Terraform Provider repositories will occasionally receive new GitHub issues relating to this when typically there are two helpful recommendations:
For newer practitioners or those unfamiliar with why they might be receiving this error, it might be helpful to include some of this additional troubleshooting information with the error message.
Proposal
For resource arguments, catch and wrap the HCL error message with some additional Terraform context:
The same could theoretically be tailored and applied for provider arguments as well.
References
etc.
The text was updated successfully, but these errors were encountered: