Skip to content
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 "enable_accelerated_networking" is not expected here #1868

Open
1 task
nerfandito opened this issue Oct 23, 2024 · 4 comments
Labels

Comments

@nerfandito
Copy link

Extension Version

v2.33.0

VS Code Version

Version: 1.94.2 (user setup)
Commit: 384ff7382de624fb94dbaf6da11977bba1ecd427
Date: 2024-10-09T16:08:44.566Z
Electron: 30.5.1
ElectronBuildId: 10262041
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.22631

Operating System

Windows 11 Enterprise 23H2 (Build 22631.4317)

Terraform Version

Terraform v1.7.4

Steps to Reproduce

When you write thist code, the attribute "enable_accelerated_networking" is detected as error incorrectly.

resource "azurerm_network_interface" "avd_vm_nic" {
count = length(var.machine_names)
name = "${var.machine_names[count.index]}-nic"
resource_group_name = var.rg
location = var.resource_group_location
enable_accelerated_networking = true
ip_configuration {
name = "nic${var.machine_names[count.index]}_config"
subnet_id = "${var.subnet_id}"
private_ip_address_allocation = "Dynamic"
}
}

Expected Behavior

It should not be marked red or as incorrect. The code works perfectly when executed.

Actual Behavior

It is marked in red with the following message:
Unexpected attribute: An attribute named "enable_accelerated_networking" is not expected here

Terraform Configuration

No response

Project Structure

No response

Gist

No response

Anything Else?

No response

Workarounds

Ignore the message.

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@nerfandito nerfandito added the bug Something isn't working label Oct 23, 2024
@dbanck
Copy link
Member

dbanck commented Dec 4, 2024

Hi @nerfandito,

Which version of the Azure provider are you using? I couldn't find anything in the v4 docs about the mentioned enable_accelerated_networking attribute.

@dbanck dbanck added question waiting-response and removed bug Something isn't working outdated-schema labels Dec 4, 2024
@nerfandito
Copy link
Author

nerfandito commented Dec 4, 2024

@dbanck
Copy link
Member

dbanck commented Dec 10, 2024

Thanks for the clarification! By default the language server ships with the latest available provider schema, but if you have a local installation of the provider, this version will be preferred. After running terraform init, the correct version will be used.

If you see different behaviour in your project, it may be a bug. Does running terraform init solve the problem for you?

In case you want to learn more about how we handle provider schemes, we have an explainer here: https://github.com/hashicorp/terraform-ls/blob/main/docs/schema.md

@nerfandito
Copy link
Author

Ok, now I understand. The machine I'm using VSCode from doesn't have terraform installed, so it always uses latest which I see uses "accelerated_networking_enabled" instead of "enable_accelerated_networking" (valid in 3.70), so on this machine it will always show me the error message.
Thanks a lot for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants