Combine first 6 ingredients in a medium saucepan. Heat over medium-high heat until mixture begins to simmer. Remove from heat, cover, and let infuse for 45 minutes. Remove lid, and strain mixture into a bowl discarding solid spices; set aside.
Preheat oven to 350°.
Sprinkle 1/3 cup sugar evenly over the bottom of a 9-inch pie plate. Bake at 350° for 25-30 minutes or until sugar melts and becomes golden.
Meanwhile combine pumpkin, eggs, and vanilla in a medium bowl. Stir in warm coconut milk mixture, being careful mixture isn't so hot it will cook eggs. Stir well with a wire whisk.
Pour batter into 9-inch pie plate on top of caramelized sugar.
Place pie plate into a roasting pan. Fill roasting pan with warm water, enough to rise halfway up the outside of the pie plate. Be careful not to spill water into your batter.
Bake at 350° for 50-60 minutes or until set. Insert a knife into the center of the flan to check for doneness. Knife should come out clean.
Allow flan to cool; cover and chill overnight. Run a thin knife around the sides of the flan; invert onto serving piece. Top with spun sugar, if desired.