Admiral-Piett / goaws

AWS (SQS/SNS) Clone for Development testing
MIT License
782 stars 145 forks source link

Incompatible with Node js aws-sdk #126

Closed jasonmattiace closed 6 years ago

jasonmattiace commented 6 years ago

Hi! This is less of an issue with goaws and more of an issue with the Node.js aws-sdk. I am able to setup goaws correctly and pass all of the tests from the aws cli, however when using the local SNS ARN, I am receiving the following error:

Invalid parameter: TopicArn Reason: A local ARN must begin with arn:null, not arn:aws:sns:local:000000000000:topic1

My code is simple

AWS.config.update({
    region: 'us-west-1'
});
var sns = new AWS.SNS();
var params = {
    Message: 'some text'
    TopicArn: 'arn:aws:sns:local:000000000000:topic1
}; 
sns.publish(params)

I am wondering if anyone has run into this issue before?!

p4tin commented 6 years ago

@jasonmattiace - I have done changes in the Arn world for version 1.0.1 - can you test that please?

p4tin commented 6 years ago

Closed - no response

aminosman commented 5 years ago

@p4tin I am having this issue, any thought? My setup is identical to @jasonmattiace

p4tin commented 5 years ago

Can you specify an endpoint in the AWS.config.update that would be my guess, from the very small snippet above...

p4tin commented 5 years ago

Here is some code that worked for me just now:

var AWS = require('aws-sdk'); 

var config = {
    region: "us-east-1",
    accessKeyId: "x",
    secretAccessKey: "x",
    endpoint: "localhost:4100",
    sslEnabled: false,
  };

AWS.config.update(config);

var sns = new AWS.SNS();

function publish(mesg) {
  var publishParams = { 
    TopicArn : "arn:aws:sns:us-east-1:100010001000:local-topic1",
    Message: "Hello World!!!"
  };

  sns.publish(publishParams, function(err, data) {
    process.stdout.write(".");
  });
}

for (var i=0; i < 2; i++) {
  publish("message: " + i);
}
aminosman commented 5 years ago

@p4tin that worked! thanks so much. Dont know why I didn't think to set the config ....