Caramelize the sugar in a round baking dish with a diameter of 9″ (22 cm) or rectangular one with a length of about 9″ (22 cm) and a width of 6″ (15 cm) and spread it on the walls of the dish.
In a bowl, whip the three eggs into foam, then add condensed milk, coconut milk, coconut flakes and vanilla. Mix well and pour it into the dish over the caramel. Bake in a preheated 338°F (170 °C) oven in a water bath for an hour or until the edges harden and the middle is slightly shaky like when baking cheesecakes.
Cool very well and only then invert it into a suitable plate but first slide a knife between the edges of the cream and dish. Cut into pieces and serve with ice cream or whipped cream.