npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@openreply/ecs-inspector

v1.0.0

Published

this node module allows you to retrieve information about an ecs instance for the current process

Downloads

7

Readme

AWS ECS Inspection

this node module allows you to retrieve information about an ecs instance for the current process.

During discovery this module will perform several http calls against the local ecs agent and the ec2 metadata service. AWS throttles queries to the instance metadata service on a per-instance basis and places limits on the number of simultaneous connections from an instance to the instance metadata service.

Getting Started

Installing

you can install this package via npm

npm i @openreply/ecs-inspector

Usage

const inspector = require('@openreply/ecs-inspector');
// using the promise interface
inspector().then( result => console.log(result) ).catch( error => console.error(error.message) );
// using callbacks
inspector({callback: (err, result) => {
  if (err) {
    return console.error(err.message);
  }
  console.log(result);
}});

Example result

{
  cluster: 'default',
  arn: 'arn:aws:ecs:eu-central-1:123456789012:task/9c621769-1a09-42c7-8d5d-2ba3319682c7',
  dockerId: '2418684f95999553475079f1c6845f5b6cc99a057cbe680a82ad3396db799542',
  containerName: 'service-b',
  ports: [{
    protocol: 'tcp',
    container: 3000,
    host: 36092
  }],
  publicHostname: 'some-host.example.com',
  publicIpv4: '134.102.200.14',
  localHostname: 'private-hostname.internal',
  localIpv4: '10.0.1.10'
}

ECSTaskInformationPortInfo : Object

Kind: global typedef
Properties

| Name | Type | Description | | --- | --- | --- | | protocol | string | protocol used e.g. tcp | | container | number | port on the container side | | host | number | port on the host side |

ECSTaskInformation : Object

Kind: global typedef
Properties

| Name | Type | Description | | --- | --- | --- | | arn | string | aws arn uniquely identifying the task | | cluster | string | name of the cluster | | dockerId | string | docker id | | containerName | string | name of the container | | publicHostname | string | public dns domain name of the ec2 instance (if available) | | publicIpv4 | string | public ipv4 address of the ec2 instance (if available) | | localHostname | string | private dns domain name of the ec2 instance (if available) | | localIpv4 | string | private ipv4 address of the ec2 instance (if available) | | ports | Array. | docker to host port mapping |

See the API documentation for more details.

Running the tests

You can run the test suite via

npm test

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of authors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

References