Is there a way we can write Security Groups in JSON

I am having Security groups in multiple environments with different structure so I cannot use for_each or any other method to simplify IAC, so wondering is there a way I can pass “EGRESS” and “INGRESS” rules in IAC something like

resource “aws_security_group” “security_group_3” {
name = “md-sg”
description = “ESG maintained by terraform”
vpc_id = “vpc-0-----------”
egress = file(“SecurityGroup/egress.json”)
}

And the JSON file looks like
→ egress.json
{
“Description”: “Create a VPC with a SG which references itself”,
“AWSTemplateFormatVersion”: “2010-09-09”,
“Resources”: {
“vpctester”: {
“Type”: “AWS::EC2::VPC”,
“Properties”: {
“CidrBlock”: “172.16.0.0/23”,
“EnableDnsSupport”: false,
“EnableDnsHostnames”: false,
“InstanceTenancy”: “default”,
“Tags”: [ { “Key”: “Name”, “Value”: “vpctester” } ]
}
}
}
}