Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws-cfm-utils

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-cfm-utils - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

41

helpers/asg/resume_scheduled_actions.js

@@ -6,29 +6,24 @@ 'use strict';

const { describeAutoScallingGroup } = require('./describe_autoscalling_group.js');
const sleep = require('util').promisify(setTimeout);
try {
const autoScalingGroups = await getAutoScalingGroups(cfm, stackname);
const autoScalingGroups = await getAutoScalingGroups(cfm, stackname);
autoScalingGroups.forEach(async (group) => {
let asgStatus;
autoScalingGroups.forEach(async (group) => {
let asgStatus;
try {
asgStatus = await describeAutoScallingGroup(asg, group);
while (asgStatus[0].ProcessName === 'ScheduledActions') {
console.log('Resuming ASG ScheduledActions in: ' + group);
await asg.resumeProcesses({
AutoScalingGroupName: group, ScalingProcesses: ['ScheduledActions']
}).promise();
asgStatus = await describeAutoScallingGroup(asg, group);
asgStatus = await describeAutoScallingGroup(asg, group);
}
}
catch (err) {
return err.stack;
}
});
}
catch (err) {
return err.stack;
}
await asg.resumeProcesses({
AutoScalingGroupName: group, ScalingProcesses: ['ScheduledActions']
}).promise();
await sleep(1000);
asgStatus = await describeAutoScallingGroup(asg, group);
if (asgStatus == undefined || asgStatus === '' || asgStatus.length === 0) {
console.log('Resumed ASG ScheduledActions in: ' + group);
}
});
await sleep(10000);
};

@@ -35,0 +30,0 @@

@@ -10,4 +10,2 @@ 'use strict';

await sleep(10000);
try {

@@ -45,11 +43,6 @@ const autoScalingGroups = await getAutoScalingGroups(cfm, stackname);

console.log('Suspended ASG ScheduledActions in: ' + group);
return true;
}
else {
return false;
}
}
catch (err) {
return err.stack;
console.error(err);
}

@@ -59,3 +52,3 @@ });

catch (err) {
return err.stack;
console.error(err);
}

@@ -62,0 +55,0 @@ };

@@ -56,8 +56,4 @@ 'use strict';

try {
await suspendScheduledActions(asg, cfm, args.stackName);
}
catch (err) {
console.error(err);
}
console.log('Suspending ASG actions...');
await suspendScheduledActions(asg, cfm, args.stackName);

@@ -70,5 +66,7 @@ try {

console.log('Update not required. No changes to the cfm stack! ' + err + '\n');
await resumeScheduledActions(asg, cfm, args.stackName);
process.exit(0);
}
console.error('Exiting with error type: ' + err.stack);
await resumeScheduledActions(asg, cfm, args.stackName);
process.exit(2);

@@ -92,2 +90,3 @@ }

console.log('Aborting - Timeout while updating');
await resumeScheduledActions(asg, cfm, args.stackName);
process.exit(1);

@@ -108,11 +107,8 @@ }

console.log('Failure - Stack update unsuccessful');
await resumeScheduledActions(asg, cfm, args.stackName);
process.exit(1);
}
try {
await resumeScheduledActions(asg, cfm, args.stackName);
}
catch (err) {
console.error(err);
}
console.log('Resuming ASG actions...');
await resumeScheduledActions(asg, cfm, args.stackName);

@@ -119,0 +115,0 @@ console.log('Success - Stack Updated successfully! \n');

@@ -22,3 +22,3 @@ 'use strict';

catch (err) {
return err.stack;
console.error(err);
}

@@ -25,0 +25,0 @@ };

{
"name": "aws-cfm-utils",
"version": "1.6.1",
"version": "1.6.2",
"description": "AWS utils to deploy cloudformation stack/templates",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc