I think the main new situation in your case compared to some other examples discussed here before is that some of the values for this attribute will be null
because the attribute is optional. Therefore you’ll need to filter out those null values before trying to combine the remaining values.
[for r in var.host_rule_set : r.a_h if r.a_h != null]
The result of that should be a list of lists ignoring any of the items that had a null list. You could then use the flatten
function to flatten that into a single list of strings.