@cloud-copilot/iam-lens
Version:
Visibility in IAM in and across AWS accounts
28 lines • 1.08 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTestDatasetClient = getTestDatasetClient;
const fs_1 = require("fs");
const path_1 = require("path");
const collect_js_1 = require("../collect/collect.js");
/**
* Get an IAMCollectClient for a test database
*
* @param dataSetId the ID of the test dataset to use
* @returns IamCollectClient instance configured for the specified dataset
*/
function getTestDatasetClient(dataSetId) {
const path = (0, path_1.resolve)((0, path_1.join)('./src', 'test-datasets', `iam-data-${dataSetId}`));
if (!(0, fs_1.existsSync)(path)) {
throw new Error(`Test dataset with ID ${dataSetId} does not exist at path ${path}. Someone messed up.`);
}
return (0, collect_js_1.getCollectClient)([
{
iamCollectVersion: '0.0.0',
storage: {
type: 'file',
path: (0, path_1.resolve)((0, path_1.join)('./src', 'test-datasets', `iam-data-${dataSetId}`))
}
}
], 'aws');
}
//# sourceMappingURL=testClient.js.map