I am importing a module, which creates resources in including security group. I don’t have access to the code/repo for this module. but i want add additional egress and ingress rule to the security group created by this module.
once the security group is created . can i import or get reference to the security group created and add ingress/egress rule.
i suppose, after first terraform apply, the security group will be created. in second iteration, can i refer the security group created and apply additional egress/ingress rule ?
module "my_module" {
source = "thirdparty/module"
...
}
resource "aws_security_group_rule" "example" {
type = "ingress"
from_port = 0
to_port = 65535
protocol = "tcp"
cidr_blocks = [aws_vpc.example.cidr_block]
security_group_id = ''
}