gcp-inventory

1.0.1 • Public • Published

gcp-inventory

A project aimed at creating the simplest possible inventory from GCP. It uses a GCS bucket to store a CSV with the audit and SMTP to send the CSV.

What is audited?

VMs, Disks, Snapshots, Firewall rules, IAM - Users and roles

Install

git clone https://github.com/nestoru/gcp-inventory.git
cd gcp-inventory
npm install

Run

set -a \
TMP_DIR=/tmp \
&& GCP_BUCKET=*** \
&& SMTP_USER=*** \
&& SMTP_PASSWORD=*** \
&& SMTP_HOST=*** \
&& SMTP_PORT=*** \
&& SMTP_FROM=*** \
&& SMTP_TO=***m \
&& node gcp-inventory.js \
&& set +a

Cron it

  • Include ENV VARS in ~/.profile
  • Cron it, for example at 8 AM on the 1st of every month
0 8 1 * * . ~/.profile && (mkdir -p /tmp/gcp-inventory && cd /tmp/gcp-inventory && git pull) || (rm -fr /tmp/gcp-inventory && cd /tmp && git clone https://github.com/nestoru/gcp-inventory.git) && cd /tmp/gcp-inventory && npm install && node gcp-inventory.js

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1

Package Sidebar

Install

npm i gcp-inventory

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

13.8 kB

Total Files

4

Last publish

Collaborators

  • nestoru