Tag: amazon-web-services

AWS lambda read parameter or outputs from CloudFormation

Looks as really simple task but it’s difficult to find good example on it. So, the task is following: AWS lambda puts some message to AWS-SQS. Code of AWS lambda contains such line: var QUEUE_URL = ‘https://sqs.us-west-2.amazonaws.com/ID/QUEUE_NAME’;”, In order to get rid of this code there are possible two options: Create query that will lookup […]

Serverless Framework with AWS Lambda error “Cannot find module”

I’m trying to use the Serverless Framework to create a Lambda function that uses open weather NPM module. However, I’m getting the following exception, but my node_modules contain the specific library. I have managed to run the sample, (https://github.com/serverless/examples/tree/master/aws-node-rest-api-with-dynamodb) successfully, now hacking to add node module to integrate open weather API. Endpoint response body before […]

Connecting to AWS Elasticsearch from non-AWS node.js app

I’m working on puzzling out an infrastructure-ish issue with a project I’m working on. The service that I’m developing is hosted on a transient, containerized platform w/o a stable IP — only a domain name (api.example.com). I’m utilizing Elasticsearch for search, so requests go to something like /my-search-resource and then use ES to find results to […]

Nodejs DynamoDB CreateTable hash only with no range returns ValidationException

I am trying to create a table on dynamodb trough their aws-sdk on nodejs. Below is the parameter I am passing on dynamodb.createTable: { TableName: ‘new_table’, ProvisionedThroughput: { ReadCapacityUnits: 1, WriteCapacityUnits: 1 }, KeySchema: [ {AttributeName: ‘primary_key’, KeyType: ‘HASH’} ], AttributeDefinitions: [ {AttributeName: ‘primary_key’, AttributeType: ‘S’}, {AttributeName: ‘some_attribute’, AttributeType: ‘S’} ] } This returns ValidationException: […]

node.js Amazon s3 how to check file exists

I’m trying to figure out how to do the equivalent of fs.exists() on S3. I succeed in getting the contents of the bucket, but I cannot figure out how to ask S3 if a specific file exists in the bucket (I don’t want to download the entire list of files and check client-side, because there […]

how to enable WebSocket with nginx on AWS Elastic Beanstalk server?

I deploy a nodejs application on the aws beanstalk servers and want to use socket.io feature based on WebSocket protocol. I know there’s a discussion here to directly connect to nodejs servers instead of using nginx as an proxy server. But if I still want to have the nginx as proxy server because of extra […]

FAIL: Deploy MEAN.js app to Elastic Beanstalk

I’m deploying my MEAN.js Node app to AWS. Steps 1-4 are the commands I run from my local machine: 1) grunt build (DONE) 2) git commit -m “production deployment” my newly concatenated production files. (DONE) 3) Set NODE_ENV=productionon AWS. (DONE) 3) Set the AWS “NodeCommand” to grunt. (DONE) 4) git aws.push (DONE) At this point […]

Logging Elastic Beanstalk Node Application

I have a node app running on AWS Elastic Beanstalk. Logs are stored in S3. The logs I care about (right now) are custom error logs my app produces. What is the best practice that can pull these logs and display them in a readable manner? This can involve a 3rd party service or open […]

Environment Variables / oracledb on Elastic Beanstalk

We are trying to install the node module oracledb on an Amazon Elastic Beanstalk instance. We can get oracledb working fine locally, and we have gotten to the point where the Beanstalk instance installs instantclient via the rpms. What we are stuck on now is that npm install expects to either use LD_LIBRARY_PATH or for […]

slc start giving error Error: pm failed, exit with status 1

I’m running a nodeapp on Centos6 AWS ec2 machine. I’ve installed strongloop using this command npm install -g strongloop. slc -h is available for me. I’m having express.js application my application start point is in /app_path/bin/www for both slc start and slc start www command in /app_path/bin/ giving me following error Error: pm failed, exit […]

Node.js is the Best Javascript runtime in the world.