The list has fewer items than the index
CommonTwo subnets assumed, one supplied; a data source that returned fewer results in this region or account.
Confirm
echo 'length(var.subnets)' | terraform console
A length less than or equal to the index used
Fix
- Pass the values the configuration expects, or iterate over what exists with for_each or count = length(…) instead of fixed positions.
- If the item is genuinely optional: try(var.subnets[1], null).