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

Allow disabling syntax validation for blocks #1612

Closed
1 task
morremeyer opened this issue Oct 30, 2023 · 4 comments
Closed
1 task

Allow disabling syntax validation for blocks #1612

morremeyer opened this issue Oct 30, 2023 · 4 comments
Labels
diagnostics enhancement New feature or request

Comments

@morremeyer
Copy link

Extension Version

v2.28.2

Problem Statement

The extension can validate the syntax for blocks, but that does not take into account all possible configurations.

From what I can see, this is mainly a concern with provider blocks since many providers can be configured with environment variables.

As an example, take this vault provider block:

Screenshot of a vault provider block with the error "Required attribute "address" not specified: An attribute named "address" is required"

However, we use Terraform Cloud and define the VAULT_ADDR environment variable with a Variable Set that is configured for our workspaces.

There is currently no way to configure the extension to either connect to Terraform Cloud to also take these configurations into account or to disable syntax validation for these blocks.

Expected User Experience

I would like for the syntax validation to not flag correct provider configurations as incorrect.

Proposal

I would like the syntax validation to support either:

  • Being disable for specific blocks. This could be as simple from the user perspective as a comment # terraform: ignore-next-block comment
  • Allow for some sort of configuration for provider blocks that indicates that a configuration value is set from an environment variable. This configuration can then be taken into account by the syntax validation. This could even be a terraform core feature, making configuration easier to understand (since currently, nothing tells users that a certain value is read from the environment)

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
@morremeyer morremeyer added the enhancement New feature or request label Oct 30, 2023
@dbanck
Copy link
Member

dbanck commented Oct 30, 2023

Thank you for the suggestion! We started looking into this as part of #1597, but this is a good, more general summary.

@morremeyer
Copy link
Author

Thank you! I couldn't find #1597 even though I looked for various combinations of keywords. It might be worth closing it in favour of this issue to keep things in one place 🤔

@radeksimko
Copy link
Member

Thanks for the report, I have opened #1616 to describe the problem in a more general way and added some context. It is something we will likely have to address soon as it's obviously wrong/misleading.

I also filed hashicorp/terraform-ls#1480 to track the suggested feature with in-line comments.

I will close this issue for now but feel free to subscribe to either of the two.

@radeksimko radeksimko closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2023
Copy link

github-actions bot commented Dec 1, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
diagnostics enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants