terraform-aws-modules / terraform-aws-security-group

Terraform module to create AWS Security Group resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/security-group/aws
Other
562 stars 1.08k forks source link

fix: TFlint warnings #328

Closed foxdalas closed 1 month ago

foxdalas commented 2 months ago

Description

I have addressed the TFLint warnings by making the necessary adjustments to the code.

Motivation and Context

These changes resolve TFLint warnings related to the use of deprecated index access for list items and an unused variable declaration.

Warning: [Fixable] List items should be accessed using square brackets (terraform_deprecated_index)

  on main.tf line 5:
   5:   this_sg_id = var.create_sg ? concat(aws_security_group.this.*.id, aws_security_group.this_name_prefix.*.id, [""])[0] : var.security_group_id

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

Warning: [Fixable] List items should be accessed using square brackets (terraform_deprecated_index)

  on main.tf line 5:
   5:   this_sg_id = var.create_sg ? concat(aws_security_group.this.*.id, aws_security_group.this_name_prefix.*.id, [""])[0] : var.security_group_id

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

Warning: [Fixable] variable "auto_groups" is declared but not used (terraform_unused_declarations)

  on rules.tf line 192:
 192: variable "auto_groups" {

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

Breaking Changes

How Has This Been Tested?

foxdalas commented 2 months ago

@bryantbiggs @antonbabenko One of you can watch this PR. Thank you

github-actions[bot] commented 1 month ago

This PR has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this PR will be closed in 10 days

github-actions[bot] commented 1 month ago

This PR was automatically closed because of stale in 10 days

github-actions[bot] commented 1 week ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.