Giter Site home page Giter Site logo

Comments (6)

bigeasy avatar bigeasy commented on July 30, 2024

I'm sorry. I'm not sure I understand the problem. Please help me understand.

This is what I read: When you get a response other than 200, you want to launch a new instance at Amazon.

I don't understand the requirement that your local machine is not connected. If you are running this script from your local machine, won't it have to be connected to both request www.domain.tld and connect to EC2?

from node-ec2.

nkhine avatar nkhine commented on July 30, 2024

hi, i wanted to be able to create a 'chain' of t1.micro instances where the 'chain' is initialised from my local machine and any subsequent instances are initialised depending on the response of www.domain.tld from the EC2 instance rather then the local machine.

perhaps an easier way is to just use something like nodester to do the monitoring and the launching and shutting down of the EC2 instances, rather then using it from my local machine.

hope this makes sense.

thanks for any advise.

from node-ec2.

bigeasy avatar bigeasy commented on July 30, 2024

You are going to need to run node-ec2 on the instance you launch. Do you have a plan for that?

from node-ec2.

nkhine avatar nkhine commented on July 30, 2024

yes, i have an EC2 image which has node-ec2 running, where i manually add the configuration.json file.

are there any secure ways to pass the configuration.json data from one instance to the next? or am i missing something?

from node-ec2.

bigeasy avatar bigeasy commented on July 30, 2024

You could pass the configuration.json in as EC2 user data. You would have to create an image that has a program that runs at startup that launches your monitoring process.

Alternatively, you can use ssh or scp once the program loads to copy the configuration.json into place and start the process remotely.

Either way, a simple bash program would be a good choice for the glue.

The scp way, you'd launch your other machine using a special_key key pair. Then you can poll DescribeInstances to get an idea of when the instance is ready and get its local network IP address. Then you can copy over your configuration securely with a script like this.

#!/bin/bash

INTERNAL_IP=$1

scp -i /var/aws/lib/special_key -o StrictHostKeyChecking=no ./configuration.json $INTERNAL_IP@/var/aws/run/configuation.json

I use ssh as my secure machine to machine protocol and glue my Node.js programs together with bash.

from node-ec2.

nkhine avatar nkhine commented on July 30, 2024

ok thanks for your time and advise

from node-ec2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.