Slice chiles into thin (1/4- inch) rings, removing seeds and membrane if desired.
Peel onion, and slice into rings about the same width as peppers.
Toss vegetables together and place into clean jars.
Bring water, vinegar, salt, sugar and optional red pepper flakes to a boil in a medium saucepan.
Pour hot brine mixture over vegetables and cover tightly.
Let cool, and then refrigerate at least 24 hours.
Keeps for 4 weeks in the refrigerator.