Created
November 25, 2014 05:14
-
-
Save darthtrevino/2b38806cb06b15f52c5c to your computer and use it in GitHub Desktop.
AWS-SDK #417 - authorizeSecurityGroupIngress Error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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