Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
access user-data on EC2 machines
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
test
.gitignore
.travis.yml
Jakefile.js
Readme.md
package.json

Readme.md

ec-user-data

A very simple library to access user-data on EC2 machines (or a configuration file called ${HOME}\.deployer.json everywhere else).

This library first check of the existence of a file called ${HOME}\.deployer.json. If this file exists, the content of the file is parsed and, if the file contains valid JSON, the content is returned.

If there is no ${HOME}\.deployer.json, the library tries to access AWS Instance Metadata. In particular, this library accesses information passed using the user-data field that can be passed when launching an instance.

Command-Line Example

ubuntu@ip-10-252-172-224:/tmp$ node_modules/.bin/ec2-user-data
config= {"aws-logging":true,"application-name":"deployer","aws-log-bucket":"tmw-tailoring-qa-logs","aws-region":"us-west-2","local-ipv4":"10.252.172.224","aws-access-key-id":"AKIAJKRUL44GH2U7AP5Q","aws-secret-access-key":"EVQKm+xVCjhwbjZOlOqxDpf+eBFSIaSK13Um0uFQ","manifest":"s3://tmw-tailoring-qa/config/tailoring.json"}

Node.js Example

var config = require("ec-user-data");

return config(function (err, config) {
   if (err) {
       return console.error("retrieving config failed", err);
   }

    console.log("config=", JSON.stringify(config));
});

License

MIT License

Something went wrong with that request. Please try again.