Skip to content

No source specified for terraform_required_version warning in a local module #177

@rdimartino

Description

@rdimartino

Summary

It is not clear from the output of tflint which modules are missing a required_version for terraform. The warning just says on line 0: (source code not available) which is not helpful for finding the issue.

Command

tflint --recursive

Terraform Configuration

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.49"
    }
  }
}

data "aws_availability_zones" "available" {}

TFLint Configuration

tflint {
  required_version = "~> 0.51"
}

plugin "terraform" {
  enabled = true
  preset  = "recommended"
}

plugin "aws" {
    enabled = true
    version = "0.31.0"
    source  = "github.com/terraform-linters/tflint-ruleset-aws"
}

Output

Warning: terraform "required_version" attribute is required (terraform_required_version)

  on  line 0:
   (source code not available)

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.7.0/docs/rules/terraform_required_version.md

TFLint Version

0.51.1

Terraform Version

No response

Operating System

  • Linux
  • macOS
  • Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions