Skip to content

Commit

Permalink
Merge pull request #59 from Cox-Automotive/develop
Browse files Browse the repository at this point in the history
2.10.0 Release
  • Loading branch information
brianantonelli authored May 4, 2017
2 parents b6d74ca + e62e931 commit a142e1b
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 12 deletions.
1 change: 1 addition & 0 deletions bin/alks-iam
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var program = require('commander'),
program
.version(config.version)
.command('createrole', 'create IAM role')
.command('deleterole', 'remove an IAM role')
.command('roletypes', 'list the available iam role types')
.parse(process.argv);

Expand Down
2 changes: 1 addition & 1 deletion bin/alks-iam-createrole
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Iam.getIAMKey(program, logger, alksAccount, alksRole, false, function(err, key,

// create the role
var data = _.extend({}, developer, key);
utils.log(program, logger, 'calling api to create role: ' + JSON.stringify(data));
utils.log(program, logger, 'calling api to create role: ' + roleName);

alks.createIamRole(data, password, roleName, roleType, incDefPolicies, { debug: program.verbose, ua: utils.getUA() }, function(err, data){
if(err){
Expand Down
54 changes: 54 additions & 0 deletions bin/alks-iam-deleterole
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env node
'use strict';

process.title = 'ALKS';

var program = require('commander'),
clc = require('cli-color'),
_ = require('underscore'),
async = require('async'),
alks = require('alks-node'),
config = require('../package.json'),
Iam = require('../lib/iam'),
Developer = require('../lib/developer'),
utils = require('../lib/utils');

var logger = 'iam-delete';

program
.version(config.version)
.description('remove an IAM role')
.option('-n, --rolename [rolename]', 'the name of the role to delete')
.option('-a, --account [alksAccount]', 'alks account to use')
.option('-r, --role [alksRole]', 'alks role to use')
.option('-v, --verbose', 'be verbose')
.parse(process.argv);

var roleName = program.rolename,
alksAccount = program.account,
alksRole = program.role;

utils.log(program, logger, 'validating role name: ' + roleName);
if(_.isEmpty(roleName)){
utils.errorAndExit('The role name must be provided.');
}

Iam.getIAMKey(program, logger, alksAccount, alksRole, false, function(err, key, developer, password){
if(err){
return utils.errorAndExit(err);
}

var data = _.extend({}, developer, key);
utils.log(program, logger, 'calling api to delete role: ' + roleName);

alks.deleteIamRole(data, password, roleName, { debug: program.verbose, ua: utils.getUA() }, function(err, data){
if(err){
return utils.errorAndExit(err);
}

console.error(clc.white(['The role ', roleName, ' was deleted'].join('')));
utils.log(program, logger, 'checking for updates');
utils.checkForUpdate();
Developer.trackActivity(logger);
});
});
7 changes: 2 additions & 5 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
★ Release Notes: 2017-04-25
★ Release Notes: 2017-05-04
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

Thanks for upgrading to the latest version of the ALKS CLI!

→ Better aligns functionality with ALKS website
→ Admin and IAMAdmin roles now show up without -i for sessions
→ You'll still need to pass -i to get an IAM session
→ Performance increase
→ Adds support for deleting IAM roles: alks iam help deleterole
→ Have feedback? https://github.com/Cox-Automotive/ALKS-CLI/issues

☁☁☁☁☁☁ Happy Clouding! ☁☁☁☁☁☁
8 changes: 4 additions & 4 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alks",
"version": "2.9.0",
"version": "2.10.0",
"description": "CLI for working with ALKS",
"main": "bin/alks",
"scripts": {
Expand Down Expand Up @@ -36,7 +36,7 @@
"alks"
],
"dependencies": {
"alks-node": "^0.4.0",
"alks-node": "^0.5.0",
"async": "^2.0.0-rc.6",
"chmod": "^0.2.1",
"cli-color": "^1.1.0",
Expand Down

0 comments on commit a142e1b

Please sign in to comment.