New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ec2-public-hostname

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ec2-public-hostname

Retrieve EC2 instance public hostname

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
13
85.71%
Maintainers
1
Weekly downloads
 
Created
Source

node-ec2-public-hostname

Retrieve EC2 public-hostname from instance metadata.

Note: this assumes that a metadata service is available at http://169.254.169.254/. Thus it works on EC2 instances, behavior on other machines is undefined.

Install

    npm install ec2-public-hostname

Example

    var ec2 = require("ec2-public-hostname");

    ec2.getPublicHostname(function (error, hostname) {
    	if (error) {
    		console.log(error);
    	}
        console.log("Instance Public Hostname: ", hostname);
    });

Details

Public Hostname of Amazon EC2 instances can be retrieved via http GET calls to http://169.254.169.254/latest/meta-data This module gets the public Hostname from meta-data api.

Change Log

  • 1.0.2: Dependencies update
  • 1.0.1: Dependencies update
  • 1.0.0: Basic getPublicHostname method.

License

MIT

Keywords

ec2

FAQs

Package last updated on 05 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts