You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But tflint doesn't support this, so even if multiple configurations are defined only one configuration is used.
This raises a problem in Deep Checking.
How to reproduce
$ tflint -vTFLint version 0.35.0+ ruleset.aws (0.13.2)
$ tflint2 issue(s) found:Error: "ami-088da9557aae42f39" is invalid AMI ID. (aws_instance_invalid_ami) on main.tf line 21: 21: ami = "ami-088da9557aae42f39"Error: "bootstrap" is invalid key name. (aws_instance_invalid_key_name) on main.tf line 23: 23: key_name = "bootstrap"
This error occurs even if Key Pair and AMI exist in the region ap-northeast-1, because tflint gets resources from us-east-1 using the alias us-east-1.
Solution
Change Runner.AwsClient to map map[string]*Client and creates clients per Provider Configuration
Check resource's provider attribute and get the appropriate Client from map of clients
I tried to implement this, but it doesn't work well yet.
Problem
Terraform supports defining multiple configurations for the same provider, and select which one to use on a per-resource or per-module basis.
https://www.terraform.io/language/providers/configuration#alias-multiple-provider-configurations
But tflint doesn't support this, so even if multiple configurations are defined only one configuration is used.
This raises a problem in Deep Checking.
How to reproduce
.tflint.hcl
main.tf
This error occurs even if Key Pair and AMI exist in the region
ap-northeast-1
, because tflint gets resources fromus-east-1
using the aliasus-east-1
.Solution
Runner.AwsClient
to mapmap[string]*Client
and creates clients per Provider Configurationprovider
attribute and get the appropriate Client from map of clientsI tried to implement this, but it doesn't work well yet.
#332
I'll appreciate if you help me.
It is difficult to debug because I don't know how to output the plugin log.
Reference
The text was updated successfully, but these errors were encountered: