# ec2-publicip

> Retrieve EC2 instance public ip

Latest version **1.0.4** (published 2017-01-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install ec2-publicip
pnpm add ec2-publicip
yarn add ec2-publicip
bun add ec2-publicip
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2017-01-05 |
| First published | 2016-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Manikandan TS |
| Maintainers | manikandants |
| Keywords | ec2, aws, publicip, elasticip, instance, amazon |

## Links

- npm: https://www.npmjs.com/package/ec2-publicip
- Repository: https://github.com/manikandants/node-ec2-publicip
- Homepage: https://github.com/manikandants/node-ec2-publicip#readme
- Issues: https://github.com/manikandants/node-ec2-publicip/issues
- npm.io page: https://npm.io/package/ec2-publicip

## Dependencies (3)

- [ip](https://npm.io/package/ip.md) ^1.1.4
- [async](https://npm.io/package/async.md) ^2.1.4
- [request](https://npm.io/package/request.md) ^2.79.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2017-01-05
- 1.0.3 — 2016-04-18
- 1.0.2 — 2016-03-04
- 1.0.1 — 2016-03-03
- 1.0.0 — 2016-03-03

## README

# node-ec2-publicip

Retrieve EC2 public-ipv4 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

```bash
    npm install ec2-publicip
```

## Example

```javascript
    var ec2 = require("ec2-publicip");

    ec2.getPublicIP(function (error, ip) {
    	if (error) {
    		console.log(error);
    	}
        console.log("Instance Public IP: ", ip);
    });
```

## Details

Public IPV4 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 IPV4 from meta-data api.

## Change Log
- 1.0.4: Dependencies update.
- 1.0.3: Dependencies update.
- 1.0.2: Added [example](https://tonicdev.com/npm/ec2-publicip).
- 1.0.1: Added documentation.
- 1.0.0: Basic getPublicIP with timeout error.

## License

MIT

---
_Source: https://npm.io/package/ec2-publicip · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
