Add a Create Note API

#142

Hey,
I have the issue that some other people have, where I run the two commands and nothing happens. I know that serverless is installed correctly. I have my dynamodb table connected in my serverless.yml file. Any ideas of what could be wrong?
I also made sure that I had the correct version of node written into my serverless.yml file
There may be something wrong with how I set up serverless, since when i try typing in “aws s3 ls” the response i get is ‘Connection was closed before we received a valid response from endpoint URL: “https://s3.amazonaws.com/”.’

0 Likes

#143

Oh that’s not good. If your aws commands don’t work then a lot of the other commands aren’t going to work either. Are you not connected to the internet or are you using a proxy?

0 Likes

#144

I was connected to the internet, and for some reason I couldn’t connect to AWS at all. The commands kept on timing out before they had a chance to run. I uninstalled everything and am trying to totally reinstall everything from scratch, and I will see what happens. The only issue that I could think of was that there was something wrong with how python was set up, but I am not sure.

I ended up figuring it out. I am not sure exactly what the issue was, but I think part of the issue was a permissions issue. I had created and done everything in SUDO ( in admin) and so when I tried running it, it just didn’t let me do it. There may have been other things that were the issue along the way, but I think that was the biggest one.

1 Like

#147

Is there a best practice for how to access the DynamoDB table’s region name from outside of the Lambda function in the create.js file?

My question was triggered by this comment:

  • The AWS JS SDK assumes the region based on the current region of the Lambda function. So if your DynamoDB table is in a different region, make sure to set it by calling AWS.config.update({ region: "my-region" }); before initilizing the DynamoDB client.
0 Likes

#148

Hmm I’m not entirely sure what the best practice here is. Typically, you keep your Lambdas in the same region as your Tables. Setting the region in the config is required to use the AWS SDK.

0 Likes

#149

Thank you for this comment! I decided to just move on too and found the updated format much easier to troubleshoot.

In my case I named my DynamoDB table differently than the tutorial - deviating is always risky (case in point) but I wanted the name to be recognizable down the road. For me my TableName in ‘params’ needed to be changed to my edited name

1 Like