Re-implement CosResources support

Change-Id: Ib476830ec8090e504532a0c940f3d01e6503e9cf