Closed evairmarinho closed 2 years ago
It works in my environment:
# main.tf
variable "instance_type" {}
module "ec2" {
source = "./module"
instance_type = var.instance_type
}
# module/ec2.tf
variable "instance_type" {}
resource "aws_instance" "foo" {
instance_type = var.instance_type
}
# input.tfvars
instance_type = "t1.medium"
% tflint --module --var-file input.tfvars
1 issue(s) found:
Error: "t1.medium" is an invalid value as instance_type (aws_instance_invalid_type)
on main.tf line 6:
6: instance_type = var.instance_type
Callers:
main.tf:6,19-36
module/ec2.tf:4,19-36
It may be useful to check the log output with TFLINT_LOG=debug
etc.
The original post is missing the module source and the command that you're running. As noted above this works and a full repro should indicate where there's a problem in your usage.
The original post is missing the module source and the command that you're running. As noted above this works and a full repro should indicate where there's a problem in your usage.
Hey, i just use tflint command. My configs are in the .tflint.hcl.
In my case, the module contains other module (terraform-aws-eks), without aws_instance resource block.
Thanks!
Context
I have the following scenario:
main.tf
.tflint.hcl
eks-ec2.tfvars
Running tflint, it pass. It doesn`t check the invalid instance type value in the variables.
Feature
Rule aws_instance_invalid_type verfiy module block too instead of just resource blocks.