Hi @manu.nz,
Your expression has two parts that I think suggest the problem:
- The attribute name
public_subnets
implies that this is a collection of multiple subnets, rather than a single subnet. - The operator
[*]
constructs a list of values of the attribute on its right side.
Therefore it seems that you are constructing a list of collections rather than just a single collection, which seems to agree with the error message because your first element in that case would be a collection rather than a string as required.
I’m not sure exactly what you were intending to assign to this argument, but since this argument seems to expect a set of strings perhaps the right idea would be to flatten
the result (discarding the extra level of list) and then use the toset
function to convert the result to be a set of strings.