How to verify values in variables is string or list using terraform

I want to assign values depending upon values it contain in variable. Example: Creating redis and supplying snapshotname or snapshotarns. Depending upon the value provided might be name or arns, want to assign to snapshotname or snapshotarns variable in redis. Is there way to achieve might be like identifying arns value as list and depending upon list or string will assign values

You can use a function try or split

with try, you can force to convert arn list and if there one error, you understand as a name for fallback.
with split, you can try split, if split return 0 itens, there as name of the resource, if not is there a list, not necessary list of arn, but a list.