New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@openreply/ecs-inspector

Package Overview
Dependencies
Maintainers
10
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openreply/ecs-inspector

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

1.0.0
latest
Source
npm
Version published
Weekly downloads
1
-80%
Maintainers
10
Weekly downloads
 
Created
Source

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

NameTypeDescription
protocolstringprotocol used e.g. tcp
containernumberport on the container side
hostnumberport on the host side

ECSTaskInformation : Object

Kind: global typedef
Properties

NameTypeDescription
arnstringaws arn uniquely identifying the task
clusterstringname of the cluster
dockerIdstringdocker id
containerNamestringname of the container
publicHostnamestringpublic dns domain name of the ec2 instance (if available)
publicIpv4stringpublic ipv4 address of the ec2 instance (if available)
localHostnamestringprivate dns domain name of the ec2 instance (if available)
localIpv4stringprivate ipv4 address of the ec2 instance (if available)
portsArray.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

  • Florian Schaper - Initial work - openreply-de

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

Keywords

aws ecs

FAQs

Package last updated on 23 Sep 2018

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