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

[terraform-linter] Attributes flagged incorrectly as being in the wrong location if part of an object. #310

Open
bradegler opened this issue Feb 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@bradegler
Copy link
Contributor

TL;DR

When you have a module that takes an object as a variable, and one of those variable names is in our list of ordered elements (folder_id, project_id, etc.) the linter flags them as being in the wrong position even though they cannot be anywhere else.

Example:

module "mymodule" {
  source = "modules/mymodule"

  some_object = {
        folder_id  = '12312312'
        project_id = '12312312
  }
}

This will result in a linter error such as:

main.tf:5: The attribute "folder_id" must me below any meta attributes (e.g. "for_each", "count") but above all other attributes. Attributes must be ordered organization > folder > project.

Expected behavior

This should not be flagged as an error.

Observed behavior

No response

Environment Details

abcxyz/pkg@main

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant