cascadeenergy / aws-promised Goto Github PK
View Code? Open in Web Editor NEWProvides Promises/A+ compliant versions of all your favorite AWS SDK clients.
License: MIT License
Provides Promises/A+ compliant versions of all your favorite AWS SDK clients.
License: MIT License
I was having this issue yesterday: http://stackoverflow.com/questions/32015345/data-returned-from-promises-with-aws-sdk-for-node-and-bluebird
And finally I found out what was causing it.
It may be that I don't understand properly why memoize is being used here, but, from what I understood, if I create an EC2-promised instance with a concrete configuration, like follows:
var AWS = require('aws-promised'), ec2 = AWS.ec2({region: 'us-east-1'});
If later on I need to create new EC2 instances with different regions configurations, simply because I could maybe request data per each region, by having memoize there what I get is a new instance with the previous configuration, which is wrong.
By commenting out the memoization on this file: https://github.com/davidpelayo/aws-promised/blob/master/ecs.js at the end, I get the expected results, as posted in the stackoverflow issue.
Could you elaborate why this would be happening, why memoize would be needed here and what the alternatives would be to solve my issues if there is any?
Thanks in advance.
http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-making-requests.html
@jinsyaoommen I'm not sure if you are already aware of this, but at the bottom of that page there's a description of how to make a request using a promise when they're supported either natively, or you provide a polyfill module such as bluebird.
I haven't actually confirmed that it works, just found those docs. I have doubts that it's supported fully for all the aws-sdk clients.
If promises are supported by aws-sdk and anyone gets it to work, it could be a reason to put up a notice of deprecation or abandon support for this module.
Thanks for merging all the PRs - can you publish on npm please?
I just realized how stupid it is to do:
var getS3 = require('aws-promised').getS3;
When we could just do:
var getS3 = require('aws-promised/getS3');
We should still expose them as require('aws-promised').getS3
as methods in the index.js
but this would be in tune with the moves lodash and other util libraries have made in order to make them more piecemeal modular.
I discovered https://github.com/bazaarvoice/aws-cfn-custom-resource/blob/master/lib/aws.js just now. Relevant/pertinent to get aws-promised to all services without needing a file per service?
Hi
I would like to contribute, what other modules do you need integrating? I am currently learning bluebird so think this will help me to learn.
Thanks
Simon
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.