Skip to content

Report & add missing required_version constraints #1508

Open
@radeksimko

Description

@radeksimko

Background

It is a best practice to always constrain configuration/module to a particular Terraform version. While this doesn't have to be - and probably should not be - as specific as e.g. =1.6.4 the lack of any constraint is generally considered bad practice.

The reason it's bad practice is because it exposes the future maintainers of that configuration to breaking changes, which are very much to be expected certainly between major versions such as 0.12 and v1 or v2.

Proposal

  • Report warning diagnostic for missing requirement entries inside of terraform required_version
  • Provide quickfix code action which adds required_version entries such as ~> X.Y where X.Y is the installed MAJOR.MINOR version

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions