@cloud-copilot/iam-collect
Version:
Collect IAM information from AWS Accounts
43 lines • 1.74 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ElasticFileSystemsSync = void 0;
const client_efs_1 = require("@aws-sdk/client-efs");
const client_tools_js_1 = require("../../utils/client-tools.js");
const json_js_1 = require("../../utils/json.js");
const typedSync_js_1 = require("../typedSync.js");
exports.ElasticFileSystemsSync = (0, typedSync_js_1.createTypedSyncOperation)('elasticfilesystem', 'fileSystems', (0, typedSync_js_1.createResourceSyncType)({
client: client_efs_1.EFSClient,
command: client_efs_1.DescribeFileSystemsCommand,
key: 'FileSystems',
paginationConfig: {
inputKey: 'Marker',
outputKey: 'NextMarker'
},
resourceTypeParts: (accountId, region) => ({
service: 'elasticfilesystem',
resourceType: 'file-system',
account: accountId,
region: region
}),
extraFields: {
policy: async (client, fileSystem) => {
return (0, client_tools_js_1.runAndCatch404)(async () => {
const policyResult = await client.send(new client_efs_1.DescribeFileSystemPolicyCommand({ FileSystemId: fileSystem.FileSystemId }));
return (0, json_js_1.parseIfPresent)(policyResult.Policy);
});
}
},
tags: (fileSystem) => fileSystem.Tags,
arn: (fileSystem) => fileSystem.FileSystemArn,
results: (fileSystem) => ({
metadata: {
name: fileSystem.Name,
id: fileSystem.FileSystemId,
az: fileSystem.AvailabilityZoneId,
key: fileSystem.KmsKeyId,
encrypted: fileSystem.Encrypted
},
policy: fileSystem.extraFields.policy
})
}));
//# sourceMappingURL=fileSystems.js.map