Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add aws_security_group_rule_deprecated rule #790

Merged
merged 12 commits into from
Dec 30, 2024

Conversation

kayman-mk
Copy link
Contributor

@kayman-mk kayman-mk commented Dec 14, 2024

Adds a rule which generates a warning if a aws_security_group_rule is used. According to the docs the aws_vpc_security_group_egress_rule or aws_vpc_security_group_ingress_rule should be used.

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule

@kayman-mk kayman-mk marked this pull request as ready for review December 14, 2024 19:20
@@ -0,0 +1,31 @@
# aws_security_group_rule_deprecated

// TODO: Write the rule's description here
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

func (r *AwsSecurityGroupRuleDeprecatedRule) Check(runner tflint.Runner) error {
resources, err := runner.GetResourceContent(r.resourceType, &hclext.BodySchema{
Attributes: []hclext.AttributeSchema{
{Name: r.attributeName},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there even a need to parse attributes here? Seems not, just the existence of the resource should trigger.

kayman-mk and others added 2 commits December 16, 2024 08:26
@kayman-mk
Copy link
Contributor Author

Everything addressed, docs reworked.

@kayman-mk kayman-mk requested a review from bendrucker December 16, 2024 07:45
@kayman-mk
Copy link
Contributor Author

Not sure how to decide about "enabled by default" and "severity".

@wata727 wata727 merged commit ed4ff6e into terraform-linters:master Dec 30, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants