0

I'm using pkgcloud npm for multicloud access. and i want to list out all instances from all zone (like US East (N. Virginia),US West (Oregon),US West (N. California),EU (Ireland)) etc.

here is my code

var aws = require('pkgcloud').compute.createClient({
provider : 'amazon',
key:'Secret Access Key',
keyId:'Access Key ID'
});

one more thing i need to ask you is can i use pkgcloud in production ? I've also read apache libcloud so which is better to use for production ? pkgcloud or libcloud ?

Jaydipsinh
  • 491
  • 1
  • 9
  • 27

1 Answers1

0

You can pass in zone information in the options

client.createServer({
  zone: 'us-west-2'
  // etc..
}, function (er, svr) {
  // code...
});

The AWS options aren't perfectly documented, but they are pretty easy to find in the source code: https://github.com/pkgcloud/pkgcloud/blob/master/lib/pkgcloud/amazon/compute/client/servers.js#L117-L201

indexzero
  • 1,024
  • 9
  • 5
  • I'm curious why we have region as part of the client options, but zone as a server option. Feels like that's a bit inconsistent. – Ken Perkins May 08 '14 at 17:17
  • hii, i already tried that, its not working :( , see here is code var aws = require('pkgcloud').compute.createClient({ zone: 'EC2_EU', provider : 'amazon', key:'', keyId:'' }); but its always list instances from US_EAST, even i tried zone: 'EU', but still same prb. like passing zone doesn't make sense. same if i pass in apache libcloud its work properly. its displayed instances running in EC2_EU. – Jaydipsinh May 09 '14 at 05:42
  • That is not a valid zone name. See here: http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region – indexzero May 09 '14 at 06:37
  • @indexzero i've tried zone: 'Z1BKCTXD74EZPE' and zone:'eu-west-1' but still it display instances from US_EAST, i've running instances from EU (Ireland) Region but i can't display using pkgcloud. oky here is my code var aws = require('pkgcloud').compute.createClient({ zone:'Z1BKCTXD74EZPE', provider:'amazon', key:'', keyId:'' }); – Jaydipsinh May 15 '14 at 11:50
  • @indexzero i'm using "version": "0.9.4", – Jaydipsinh May 15 '14 at 11:53