Skip to content

Instantly share code, notes, and snippets.

@darthtrevino
Created November 25, 2014 05:14
Show Gist options
  • Save darthtrevino/2b38806cb06b15f52c5c to your computer and use it in GitHub Desktop.
Save darthtrevino/2b38806cb06b15f52c5c to your computer and use it in GitHub Desktop.
AWS-SDK #417 - authorizeSecurityGroupIngress Error
Q = require('q')
aws = require('aws-sdk')
aws.config.loadFromPath('config/aws.json')
aws.Request.prototype.promise = ->
d = Q.defer()
@on 'complete', (response) ->
if response.error then d.reject(response.error)
else d.resolve(response.data)
@send()
d.promise
#
# Promisified AWS APIs
#
module.exports =
ec2: new aws.EC2()
rds: new aws.RDS()
node test.js
ERROR: { [MissingParameter: Source group ID missing.]
message: 'Source group ID missing.',
code: 'MissingParameter',
time: Mon Nov 24 2014 21:10:59 GMT-0800 (PST),
statusCode: 400,
retryable: false,
retryDelay: 30 }
{
"name": "project-infrastructure",
"version": "1.0.0",
"description": "My Project's Infrastructure Automation",
"dependencies": {
"aws-sdk": "^2.0.28",
"coffee-script": "^1.8.0",
"q": "^1.1.1"
}
}
require('coffee-script/register');
var aws = require('./aws_invoker');
aws.ec2.authorizeSecurityGroupIngress({SourceSecurityGroupOwnerId: 'sg-a509e8c1', GroupId: 'sg-a609e8c2'})
.promise()
.then(function(data) {
console.log("RESULT: ", data);
})
.fail(function(err) {
console.log("ERROR: ", err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment