How do I access dynamodb(or lambda) from a real-time server?

0

is it possible?

I have included aws-sdk in realtime server (nodejs). But the server build failed.

If anyone knows how to do this, please respond.

thx

已提問 5 年前檢視次數 247 次
16 個答案
0
已接受的答案

Hi-

The fix for this bug has now been deployed to all regions. Feel free to try again.

已回答 5 年前
0

Hi-

I'm going to loop in the engineer that validated the possibility of doing this on our side and see if they have any suggestions.

已回答 5 年前
0

This sounds like pretty much what they did. I'd suggest creating a super simple RTS fleet w/ no dependencies such that it goes active. Then update the script to what you have including the sdk. If that fails I think you should have some info available in the server logs.

If you still get stuck, let us know the fleet id along with where you got the version of the sdk you're using (npm, download, etc). We could then take a peek and see if we have further suggestions.

已回答 5 年前
0

I am facing the exactly same issue.

Please leave some tips if anyone knows any resolutions.

Other node modules, such as "loadash" and "hashish", can be loaded like below

var _ = require('loadash');
var Hash = require('hashish');

However, when aws-sdk is included in node_modules directory, the fleet seems to fail to be activated. Error occurs from Activating state.

Please let me know if you have resolved issues regarding loading aws-sdk.

Much appreciated in advance.

已回答 5 年前
0

@REDACTEDUSER

I am tagging you because you seem like you have answered a lot fo questions and might have an idea about this issue.

Please let me know if there is a resolution for it.

Thanks.

已回答 5 年前
0

hi brian, thank you for respond. i tried a simple rts but got fail. im using npm(sdk) version 2.493.0.

fleet id : fleet-******

已回答 5 年前
0

Hi @REDACTEDUSER

Thanks for your kind suggestion.

I have tried as you suggested with several other cases, however, the fleets do not seem to be updated after editing the scripts to new versions. Furthermore, no error logs come up and the fleet is created based on the previous version. I would like to know what is actually going on.

I am using npm and the version 2.488.0 and the fleet ids are fleet-******

please let me know if you get to know anything..

Thanks,

Bobby

已回答 5 年前
0

Your help would be much appreciated.

I am literally stuck and not making any progress from that point.

Please check it out for me @REDACTEDUSER

Thanks very much in advance.

已回答 5 年前
0

Hi, @REDACTEDUSER

I want to know how things work.

It's been a while since I posted my answer, but I have not responded yet, so I reply again.

已回答 5 年前
0

@REDACTEDUSER

I am tagging you expecting you can give me a solution for it since @REDACTEDUSER

Please have a look at this error and let me know what I can do about it.

Thanks very much in advance.

已回答 5 年前
0

Hi-

Thanks for the information. We are investigating and will reply once we have more information.

已回答 5 年前
0

Hi @REDACTEDUSER

I could not afford to keep those fleets due to their pricing. I have deleted them. If you find out anything or have other suggestions, please let me know.

Thanks, Bobby

已回答 5 年前
0

Hi,

@REDACTEDUSER

I took a look at your fleets and I can confirm that there is a bug with the RTS feature where scripts with aws-sdk fail to go active(or fails at updateScript). We have created a backlog item to address this bug, I will update this post once the fix for the issue is out.

已回答 5 年前
0

Hi, @REDACTEDUSER Fixed bugs were builded. but in the dynamodb(or lambda) script part, the build failed again.

Added part :

var aa = new AWS.DynamoDB.DocumentClient();

or

var aa = new AWS.Lambda();

Please Show me the example test code used to solve the problem.

已回答 5 年前
0

Do you have an example of what your logs show here? How is this code failing? Things could fail due to bad code or bad configuration. Are you failing including the SDK ie

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

AWS.config.update({
    region: "us-west-2",
    ...
});

You can debug some of this yourself while waiting for the GameLift team to respond:

  1. Deploy a minimal server that works
  2. Remote access your instance in a fleet: https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-remote-access.html
  3. Tail your logs and ensure everything is working
  4. Update your script package

1-3 are optional, just so you can be in a clean state. You can also scale your fleet to 0 and then back to 1.

已回答 5 年前
0

The important thing to get right is the structure of your zip. It should look something like:

myscript.js node_modules/aws-sdk/.....

Can you confirm whether or not that's currently the case for you?

已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南