@csermet/multiprovider
Version:
cloud-graph provider plugin for AWS used to fetch AWS cloud data.
46 lines (45 loc) • 2.04 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const sdk_1 = require("@cloudgraph/sdk");
const format_1 = require("../../utils/format");
/**
* RdsClusterSnapshot
*/
exports.default = ({ account, service: rawData, region, }) => {
const { AvailabilityZones: availabilityZones, DBClusterSnapshotIdentifier: dbClusterSnapshotIdentifier, DBClusterIdentifier: dbClusterIdentifier, SnapshotCreateTime: snapshotCreateTime, Engine: engine, EngineMode: engineMode, AllocatedStorage: allocatedStorage, Status: status, Port: port, VpcId: vpcId, ClusterCreateTime: clusterCreateTime, MasterUsername: masterUsername, EngineVersion: engineVersion, LicenseModel: licenseModel, SnapshotType: snapshotType, PercentProgress: percentProgress, StorageEncrypted: storageEncrypted, KmsKeyId: kmsKeyId, DBClusterSnapshotArn: dbClusterSnapshotArn, SourceDBClusterSnapshotArn: sourceDBClusterSnapshotArn, IAMDatabaseAuthenticationEnabled: iamDatabaseAuthenticationEnabled, Tags, attributes, } = rawData;
const mappedAttributes = attributes?.map(({ AttributeName, AttributeValues }) => ({
id: sdk_1.generateUniqueId({
AttributeName,
AttributeValues,
}),
name: AttributeName,
values: AttributeValues,
}));
return {
id: dbClusterSnapshotIdentifier,
arn: dbClusterSnapshotArn,
region,
accountId: account,
availabilityZones,
dbClusterIdentifier,
snapshotCreateTime: snapshotCreateTime?.toISOString(),
engine,
engineMode,
allocatedStorage,
status,
port,
vpcId,
clusterCreateTime: clusterCreateTime?.toISOString(),
masterUsername,
engineVersion,
licenseModel,
snapshotType,
percentProgress,
storageEncrypted,
kmsKeyId,
iamDatabaseAuthenticationEnabled,
sourceDBClusterSnapshotArn,
tags: format_1.formatTagsFromMap(Tags ?? {}),
attributes: mappedAttributes,
};
};