I am curious if there is a way to leverage a single “aws_security_group_rule” resource where a list variable is passed that contains both “cidr_blocks” and “source_security_group_id?” If not, how would you suggest managing such most efficiently?
Ultimately there is no way to accomplish the above, additionally the “aws_security_group_rule” resource does not support passing a tuple to “source_security_group_id.” A separate resource is required for CIDRs and Source Security Groups. Also, since tuples aren’t supported you will need to use a for_each statement where the tuple is converted to a set (toset).