Put the red onion slices in a medium bowl
In a medium saucepan, combine water, peppercorns, salt, garlic, star anise, coriander seeds, and sugar. Bring mixture to a boil. Remove from heat and add the vinegar, stir. Pour the mixture over the onions.
Cool completely and then refrigerate. Pickled onions will keep for a few days in a covered jar in the refrigerator.