Put water, sugar, and diced dragon fruit in a medium-size saucepan and bring mixture to a boil.
Once boiling, lower heat and let simmer for about 15 minutes, until mixture has thickened a bit and dragon fruit is softening.
If you're using white flesh dragon fruit and want a pink syrup, stir in the dragon fruit powder at this time. Stir until powder is dissolved.
Strain mixture into a bowl, being sure to press down on the dragon fruit to extract as much juice as possible.
Keep syrup in bowl or pour into a mason jar and place in fridge to cool completely before using. Syrup will continue to thicken as it cools.