UNPKG

@cloud-copilot/iam-lens

Version:

Visibility in IAM in and across AWS accounts

25 lines 896 B
import { existsSync } from 'fs'; import { join, resolve } from 'path'; import { getCollectClient } from '../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 */ export function getTestDatasetClient(dataSetId) { const path = resolve(join('./src', 'test-datasets', `iam-data-${dataSetId}`)); if (!existsSync(path)) { throw new Error(`Test dataset with ID ${dataSetId} does not exist at path ${path}. Someone messed up.`); } return getCollectClient([ { iamCollectVersion: '0.0.0', storage: { type: 'file', path: resolve(join('./src', 'test-datasets', `iam-data-${dataSetId}`)) } } ], 'aws'); } //# sourceMappingURL=testClient.js.map