@csermet/multiprovider
Version:
cloud-graph provider plugin for AWS used to fetch AWS cloud data.
27 lines (26 loc) • 865 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const generateArns_1 = require("../../utils/generateArns");
exports.default = ({ service, region, account: accountId, }) => {
const { id, path, restApiId, resourceMethods = {} } = service;
const arn = generateArns_1.apiGatewayResourceArn({
restApiArn: generateArns_1.apiGatewayArn({ region: service.region }),
id,
});
const methods = Object.values(resourceMethods).map(({ httpMethod, authorizationType, apiKeyRequired }) => ({
accountId,
arn: generateArns_1.apiGatewayMethodArn({ resourceArn: arn, httpMethod }),
httpMethod,
authorization: authorizationType,
apiKeyRequired,
}));
return {
id,
accountId,
arn,
region,
path,
methods,
restApiId
};
};