-
Notifications
You must be signed in to change notification settings - Fork 599
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
Unexpected attribute: An attribute named "content" is not expected here #3642
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Terraform debug log detected ✅ |
Added log file: https://gist.github.com/liamdawson/15b2dc72cdc9e2a3447a7fda541c79b4 I've also reproduced the same issue in the zed editor. |
Can confirm I am also seeing this error with 4.39.0 |
this isn't a provider (or version) specific issue but instead, how the LSP determines what version of the provider to use in order to validate the configuration. for this to work properly, you'll need to:
from there, you'll get the correct LSP feedback. |
@jacobbednarz I don't think that's right. Even on the latest version, even having explicitly updated the provider version constraint from |
The bug is still present in version 4.40 provider "registry.terraform.io/cloudflare/cloudflare" { "Unexpected attribute: An attribute named "content" is not expected here" |
providers don't do anything specifically for the LSP to work other than define the schema (which here, is identical to |
Did you run EDIT: I spoke too soon. I am also still seeing this error even after running |
I have no idea why this error keeps popping up. After upgrading to I've had to downgrade to If someone can shed more light onto whats happening please let me know! |
there is no further answers from me. it comes down to how it is being picked locally. |
Isn't this a breaking change added in v4.39.0? Looks like it should have been applied in v5.0.0 I manage to fix my case
|
no it is not a breaking change. |
I also hit this behavior and found it confusing.
Expected behavior: TF file appears valid with no issues Personal workaround: Explicitly run YMMV. Hope it helps someone out. |
Makes sense |
the change is documented in the changelog (https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/CHANGELOG.md#4390-august-7th-2024) and in the terraform output itself when using the deprecated value. |
I ran into the same issue with latest version (4.40). The only thing that worked for me was switching to pre-release version of HashiCorp Terraform extension in VSCode: v2.33.2024082314 |
Confirmation
Terraform and Cloudflare provider version
Affected resource(s)
cloudflare_record
Terraform configuration files
Link to debug output
https://gist.github.com/liamdawson/15b2dc72cdc9e2a3447a7fda541c79b4
Panic output
No response
Expected output
The resource would validate correctly in the Visual Studio Code Terraform extension (which uses the Terraform LSP).
Actual output
The line with
content
is marked with an error:Steps to reproduce
hashicorp.terraform
extensionmain.tf
with the resource aboveterraform init
main.tf
Additional factoids
Interesting snippet in the verbose
terraform plan
output:References
The text was updated successfully, but these errors were encountered: