UNPKG

@csermet/multiprovider

Version:

cloud-graph provider plugin for AWS used to fetch AWS cloud data.

37 lines (36 loc) 1.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const format_1 = require("../../utils/format"); const generateArns_1 = require("../../utils/generateArns"); /** * Flow Log */ exports.default = ({ service: rawData, account, region, }) => { const { FlowLogId: id, DeliverLogsErrorMessage: deliverLogsErrorMessage, DeliverLogsPermissionArn: deliverLogsPermissionArn, DeliverLogsStatus: deliverLogsStatus, FlowLogStatus: logStatus, LogGroupName: groupName, ResourceId: resourceId, TrafficType: trafficType, LogDestinationType: destinationType, LogDestination: destination, LogFormat: format, MaxAggregationInterval: maxAggregationInterval, CreationTime: creationTime, Tags: tags = {}, } = rawData; // Format Flow Log Tags const flowLogTags = format_1.formatTagsFromMap(tags); const flowLog = { id, arn: generateArns_1.flowLogsArn({ region, account, flowLogId: id, }), region, accountId: account, deliverLogsErrorMessage, deliverLogsPermissionArn, deliverLogsStatus, logStatus, groupName, resourceId, trafficType, destinationType, destination, format, maxAggregationInterval, creationTime: creationTime.toISOString(), tags: flowLogTags, }; return flowLog; };