AFAIK, having a resource(s) required for a building is generally only a concern when you want to start construction: if the resource is lost even just 1 turn after that point, the building will still be completed (so long as you don't switch away from it partway through).
Otherwise, once the building completes it will provide its effects regardless of whether the required resource(s) continues to be available. The only exception is unit auto-production: if access to the required resource(s) is cut off, auto-production will also be halted.