/mmds

Missed (AWS) Meta-Data (service)

Primary LanguageGoApache License 2.0Apache-2.0

mvisonneau/mmds - Missed (AWS) Meta-Data (service)

PkgGoDev Go Report Card test Coverage Status release

mmds allows you to get some information which are currently missing from the AWS meta-data service

TL:DR

# Figure out the pricing model of the instance
~$ mmds pricing-model
spot

Usage

~$ mmds --help
NAME:
   mmds - Missed (AWS) Meta-Data (service)

USAGE:
   mmds [global options] command [command options] [arguments...]

COMMANDS:
   pricing-model  get instance pricing-model
   help, h        Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --log-level level    log level (debug,info,warn,fatal,panic) (default: "info") [$MMDS_LOG_LEVEL]
   --log-format format  log format (json,text) (default: "text") [$MMDS_LOG_FORMAT]
   --help, -h           show help (default: false)

Install

Have a look onto the latest release page and pick your flavor.

Go

~$ go install github.com/mvisonneau/mmds/cmd/mmds@latest

Homebrew (linux only)

~$ brew install mvisonneau/tap/mmds

Scoop

~$ scoop bucket add https://github.com/mvisonneau/scoops
~$ scoop install mmds

Binaries, DEB and RPM packages

For the following ones, you need to know which version you want to install, to fetch the latest available :

~$ export MMDS_VERSION=$(curl -s "https://api.github.com/repos/mvisonneau/mmds/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
# Binary (eg: freebsd/amd64)
~$ wget https://github.com/mvisonneau/mmds/releases/download/${MMDS_VERSION}/mmds_${MMDS_VERSION}_freebsd_amd64.tar.gz
~$ tar zxvf mmds_${MMDS_VERSION}_freebsd_amd64.tar.gz -C /usr/local/bin

# DEB package (eg: linux/386)
~$ wget https://github.com/mvisonneau/mmds/releases/download/${MMDS_VERSION}/mmds_${MMDS_VERSION}_linux_386.deb
~$ dpkg -i mmds_${MMDS_VERSION}_linux_386.deb

# RPM package (eg: linux/arm64)
~$ wget https://github.com/mvisonneau/mmds/releases/download/${MMDS_VERSION}/mmds_${MMDS_VERSION}_linux_arm64.rpm
~$ rpm -ivh mmds_${MMDS_VERSION}_linux_arm64.rpm

Develop / Test

~$ make
all                            Test, builds and ship package for all supported platforms
build                          Build the binaries using local GOOS
clean                          Remove binary if it exists
coverage-html                  Generates coverage report and displays it in the browser
coverage                       Generates coverage report
fmt                            Format source code
gofumpt                        Test code syntax with gofumpt
gosec                          Test code for security vulnerabilities
help                           Displays this help
ineffassign                    Test code syntax for ineffassign
install                        Build and install locally the binary (dev purpose)
is-git-dirty                   Tests if git is in a dirty state
lint                           Run all lint related tests against the codebase
misspell                       Test code with misspell
prerelease                     Build & prerelease the binaries (edge)
release                        Build & release the binaries (stable)
revive                         Test code syntax with revive
setup                          Install required libraries/tools for build tasks
test                           Run the tests against the codebase
vet                            Test code syntax with go vet

Contribute

Contributions are very welcome! Feel free to submit a PR.