Replies: 14 comments
-
@nitrocode Are you thinking along the lines of a rule named |
Beta Was this translation helpful? Give feedback.
-
Yes exactly |
Beta Was this translation helpful? Give feedback.
-
I'll try and get this knocked out. I think this is a great thing to have and am going to make use of it as soon as it is released! |
Beta Was this translation helpful? Give feedback.
-
Would be nice for this to take a map of suggested resources and the preferred alternative as opposed to just returning that something was blacklisted. I'm not sure what actual use cases there'd be for entirely blacklisting a resource with no suggested alternative. |
Beta Was this translation helpful? Give feedback.
-
@bendrucker yes or even a custom message could be printed if the code was flagged due to the
@bendrucker, |
Beta Was this translation helpful? Give feedback.
-
Ha, was typing as I saw your edit. In theory I could imagine someone wanting to blacklist a resource with no alternative because it has bugs, but that seems like a pretty narrow/tricky use case. Suggestions to use b instead of a could cover a lot of providers—the Google provider has resources with similar caveats, e.g.: https://www.terraform.io/docs/providers/google/r/google_organization_iam_binding.html |
Beta Was this translation helpful? Give feedback.
-
It would be nice to have this within the provider so tools could leverage this information. It sort of already exists as the documentation for a provide has the information. |
Beta Was this translation helpful? Give feedback.
-
@nitrocode I have an initial version of the rule: terraform-linters/tflint#769 |
Beta Was this translation helpful? Give feedback.
-
In my opinion, it is better to obviously resources that should be avoided (like On the other hand, I agree that such a rule is effective when you want to avoid some resources for some special reason, but if possible, I want to make it a tool that provides such best practices. |
Beta Was this translation helpful? Give feedback.
-
That starts to add an opinion with regards to best practices and each organization is going to have their own view on what's best for them. IMO TFLint is best served to provide a framework for people to enforce rules. The overhead associated with understanding all of the resources associated with a provider is a large amount of work. |
Beta Was this translation helpful? Give feedback.
-
+1 from me on usable defaults, e.g. suggesting alternatives to |
Beta Was this translation helpful? Give feedback.
-
👍 Since these things are very much provide specific, can we say that the |
Beta Was this translation helpful? Give feedback.
-
Yes. I'd avoid making the tests or examples too AWS centric to help avoid confusion with an eventual AWS-specific rule. |
Beta Was this translation helpful? Give feedback.
-
@mveitas are there still chances, that this rule will be implemented? |
Beta Was this translation helpful? Give feedback.
-
There is a large warning for the resource
aws_iam_policy_attachment
to useaws_iam_role_policy_attachment
instead.I'd like to prevent the first resource from getting into our infrastructure with an appropriate tflint rule. We could make it specific to this resource but I'd prefer a more generic one so if we find a future resource, we can simply add it to a list within the rule.
Edit: @mveitas put in PR terraform-linters/tflint#769
Beta Was this translation helpful? Give feedback.
All reactions