Skip to content

security group being created even if the security_group_ids is empty #192

@danielaraujobc

Description

@danielaraujobc

Describe the Bug

The "default" module security group is being created even if the parameter security_group_ids is empty. From what I saw, this SG will be made if these security_group_ids are filled with the allowed SGs to inbound.

For reference, in the line 193 only creates the SG with the ingress rules if security_group_ids is filled. But the same is not happening with the "egress" rules.

resource "aws_security_group_rule" "egress" {
[...]
}

In the end I have a SG with no inbounds

image

and a single outbound

image

Expected Behavior

If security_group_ids is empty, no Security Groups must be created.

Steps to Reproduce

Create an instance without (or empty list) the security_group_ids parameter and with the parameter associate_security_group_ids filled.

module "rds" {
  source  = "cloudposse/rds/aws"
  version = "1.1.2"
  associate_security_group_ids = ["my-existing-sg"]
}

Screenshots

No response

Environment

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions