Heat oil in a deep non stick pan, add cinnamon, cloves, star anise and shallots and sauté.
Add garlic to the pan and sauté till browned.
Cut pineapple into medium cubes and add to the pan
Grind together fresh red chillies and coconut with a little water to a paste.
Add turmeric powder, ground coconut, cucumber and a little water to the pan and mix. Add peanuts and salt and mix well. Add tamarind pulp and thick coconut milk and mix. Cover and cook, on medium heat, for 15 minutes or till both pineapple and cucumber soften and the gravy thickens.