EzDevInfo.com

aws-lib

Extensible Node.js library for the Amazon Web Services API aws-lib.js

AWS Lambda Java done() Method

I don't see a done() method in the Context object of the Java implementation of AWS lambda.

In node, you can perform a bunch of async operations and then call done() when everything has completed. The lambda is considered unfinished until done() is called.

I would like to do something similar in Java, but I don't see the done() method. So then when is a Java implementation of a lambda function considered "done"? When it returns? Do I have to instead block on everything before returning? That seems crumby.


Source: (StackOverflow)

Node AWS-lib: repeated calls to AWS-lib causes bad signature

I am running the same EC2 API call repeatedly, as I wait for an instance to be started.

var check_started = function() {
  console.log('Calling');
  ec2.call("DescribeInstanceStatus", {InstanceId:['pretend_instance_id']}, function(err, status_result){
    if (err) {
      console.log('error')
      console.log(err)
      console.log(status_result)
    } else {
      console.log('success')
    }
  }); 
}

var instance_started_checker = setInterval( check_started, 5 * 1000)

The first call always succeeds, but subsequent calls fail with:

The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

What can I do to make the repeated calls work?


Source: (StackOverflow)

Advertisements

Node AWS-lib: CreateTags action 'not valid for the web service'

I am using Node's aws-lib module. I understand it's a fairly thin wrapper around the node API, eg running call("CreateTags") will wrap the CreateTags call as documented in the API.

I'm successfully calling other API functions, eg, RunInstance and DescribeInstances work fine. However CreateTags causes problems:

ec2.call("CreateTags", {
  'ResourceId.1':notmyrealresourceid,
  'Tag.1.Key':'Name'
  'Tag.1.Value':'Somemachine'
}, function(err, result){
  if ( err) {
    console.log('Failure tagging image');
    console.log(err)
  }
}) 

Responds with the following in err:

The action CreateTags is not valid for this web service.

The API definitely mentions CreateTags exists. How can I make it work? What am I missing? Thanks!


Source: (StackOverflow)