Question

I am using https://github.com/bevacqua/grunt-ec2 to connect to, and update a bucket for, Amazon AWS. When I execute any of the ec2 commands (for example: grunt ec2_list_json:all) it hangs and never responds. Here are what the relevant files look like:

Gruntfile.js

// Generated on 2014-04-28 using angfull 1.4.2
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Define the configuration for all the tasks
  grunt.initConfig({

    pkg: grunt.file.readJSON('package.json'),
    ec2: 'aws-credentials.json',

    ...

  });

  grunt.loadNpmTasks('grunt-ec2');

  ...

aws-credentials.json

{
  "AWS_ACCESS_KEY_ID": "xxx",
  "AWS_SECRET_ACCESS_KEY": "xxx",
  "AWS_SECURITY_GROUP": "xxx",
  "AWS_DEFAULT_REGION": "us-east-1d",
  "AWS_IMAGE_ID": "ami-05355a6c",
  "NODE_SCRIPT": "server.js"
}

When I execute a command that requires connecting to the AWS instance - it hangs. Clearly it isn't connecting at all - I'm just not sure why. Thanks.

Was it helpful?

Solution

The config should be as follows:

{
  "AWS_ACCESS_KEY_ID": "xxx",
  "AWS_SECRET_ACCESS_KEY": "xxx",
  "AWS_SECURITY_GROUP": "xxx",
  "AWS_DEFAULT_REGION": "us-east-1",
  "AWS_IMAGE_ID": "ami-05355a6c",
  "NODE_SCRIPT": "server.js"
}

Basically, us-east-1d is an availability zone within us-east-1 and not a region.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top