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

node-iam

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-iam

Simple wrapper for using Amazon IAM API

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

node-iam

This is an AWS IAM client for Node.js. For a real use-case, see aws-bootstrap.

Pre-Reqs

Via the command line, or process.env, set:

process.env['AWS_ACCESS_KEY_ID'] = '<ID>'; 
process.env['AWS_SECRET_ACCESS_KEY'] = '<KEY>';

Then instantiate a new client in your application:

var REST = require('node-iam');
var client = new REST.AmazonIAMClient();

All responses are returned in JSON. When useful, cleaned-up objects are returned.

Usage

To create a group:

client.createGroup('<groupName>', function(response) {
  console.log(response);
});

To view groups:

client.listGroups(function(response, groups) {
  console.log(response);
  groups.forEach(function(group) {
    console.log('Group: ' + group);
  });
});

To create a group security policy:

var policy = '{"Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}';
client.putGroupPolicy('<groupName>', '<groupPolicyName>',  policy, function(response) {
  console.log(response);
});

To list security policies for a group:

client.listGroupPolicies('<groupName>', function(response, policies) {
  console.log(response);
});

To create a user:

client.createUser('<userName>', function(response) {
  console.log(response);
});

To allow a user login:

client.createUserLoginProfile('<userName>', '<password>', function(response) {
  console.log(response);
});

To view users:

client.listUsers(function(response, users) {
  console.log(response);
  users.forEach(function(user) {
    console.log('User: ' + user);
  });
});

To add a user to a group:

client.addUserToGroup('<userName>', '<groupName>', function(response) {
  console.log(response);
});

To create a user security policy:

var policy = '{"Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}';
client.putUserPolicy('<userName>', '<userPolicyName>', policy, function(response) {
  console.log(response);
});

To list security policies for a user:

client.listUserPolicies('<userName>', function(response, policies) {
  console.log(response);
});

To list access keys for a user:

client.listAccessKeys('<userName>', function(response) {
  console.log(response);
});

To list access keys at a higher level:

client.listAccessKeys(function(response) {
  console.log(response);
});

To create credentials for a user:

client.createAccessKey('<userName>', function(response) {
  console.log(response);
});

To delete credentials for a user:

client.deleteAccessKey('<userName>', function(response) {
  console.log(response);
});

To view an account summary:

client.getAccountSummary(function(response) {
  console.log(response);
});

Keywords

FAQs

Package last updated on 09 Mar 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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