It is illegal, but easy to obtain. You should not smoke openly. If the resort sees you doing it, they will ask you to stop, but won't arrest you. If they catch you repeatedly they might throw you out. If police see you, they will arrest you.
Before you even leave the airport, people will be offering to sell it to you. At the resorts, sometimes landscape workers will quietly ask if you "have every thing you need". You'll also be approached by people on the beach if it's public. If it's private, you'll often see people in small boats calling "pssssst".