What is the relationship between aws_security_group_rule and aws_security_group resources

Is there some documentation on the relationship between aws_security_group and aws_security_group_rule in aws resources. the aws_security_group_rule has an attribute ,source_security_group_id, and a different one, security_group_id. I was expecting to be able attach one or more aws_security_group_rule resources to an aws_security_group. using either of the 2 attributes before mentioned.( I have seen the note that says that says “at this time you cannot use a Security Group with in-line rules in conjunction with any Security Group Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules.”). I have tried various combinations and have not succeeded. The hashicorp terraform documentation (https://www.terraform.io/docs/providers/aws/r/security_group_rule.html) doesn’t help enlighten me. Can someone point me to a better explanation, a clear example or intelligible documentation