Skip to content

Commit

Permalink
Update dependencies; AWS-SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
dxdc committed Nov 3, 2022
1 parent aa5becd commit 84801d5
Show file tree
Hide file tree
Showing 7 changed files with 46,296 additions and 12,006 deletions.
2 changes: 1 addition & 1 deletion aws-sdk-js
Submodule aws-sdk-js updated 672 files
4 changes: 2 additions & 2 deletions dist/AwsSdk.js

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions dist/EC2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
function listEC2Instances(region = null) {
var ec2Promise = new AWS.EC2({
apiVersion: '2016-11-15',
region: region || AWS.config.region,
})
.describeInstances()
.promise();

return ec2Promise
.then((data) => {
return data;
})
.catch((err) => {
Logger.log(err, err.stack);
return false;
});
}

function listSecurityGroups(region = null) {
var ec2Promise = new AWS.EC2({
apiVersion: '2016-11-15',
region: region || AWS.config.region,
})
.describeSecurityGroups()
.promise();

return ec2Promise
.then((data) => {
return data;
})
.catch((err) => {
Logger.log(err, err.stack);
return false;
});
}
30 changes: 30 additions & 0 deletions dist/Examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,33 @@ async function invokeLambdaTest() {
Logger.log(result);
return result;
}

async function listEC2InstancesTest() {
initConfig(AWS_CONFIG_TEST);
var result = await listEC2Instances('us-west-2');
var instances = [];

if (result !== false) {
if (result.hasOwnProperty('reservationSet') && result.reservationSet.hasOwnProperty('instancesSet')) {
instances = result.reservationSet.instancesSet;
}
}

Logger.log(`${instances.length} instance${instances.length === 1 ? '' : 's'}`);
return instances;
}

async function listSecurityGroupsTest() {
initConfig(AWS_CONFIG_TEST);
var result = await listSecurityGroups('us-west-2');
var groups = [];

if (result !== false) {
if (result.hasOwnProperty('securityGroupInfo')) {
groups = result.securityGroupInfo;
}
}

Logger.log(`${groups.length} security group${groups.length === 1 ? '' : 's'}`);
return groups;
}
Loading

0 comments on commit 84801d5

Please sign in to comment.