The US president has followed through on taxing imports from two of the country's closest neighbours.