UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 590 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.handler=void 0;const AWS=require("aws-sdk");async function handler(event){console.log("Event: %j",{...event,ResponseURL:"..."}),console.log("AWS SDK VERSION: "+AWS.VERSION);const awsService=new AWS[event.service](event.apiVersion&&{apiVersion:event.apiVersion});try{const response=await awsService[event.action](event.parameters).promise();console.log("Response: %j",response)}catch(e){if(console.log(e),!event.catchErrorPattern||!new RegExp(event.catchErrorPattern).test(e.code))throw e}}exports.handler=handler;